summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mg.c b/mg.c
index c2d2186e96..b7f9c05d8b 100644
--- a/mg.c
+++ b/mg.c
@@ -661,21 +661,21 @@ Perl_magic_regdatum_get(pTHX_ SV *sv, MAGIC *mg)
const REGEXP * const rx = PM_GETRE(PL_curpm);
if (rx) {
const I32 paren = mg->mg_len;
- I32 s;
- I32 t;
+ SSize_t s;
+ SSize_t t;
if (paren < 0)
return 0;
if (paren <= (I32)RX_NPARENS(rx) &&
(s = RX_OFFS(rx)[paren].start) != -1 &&
(t = RX_OFFS(rx)[paren].end) != -1)
{
- I32 i;
+ SSize_t i;
if (mg->mg_obj) /* @+ */
i = t;
else /* @- */
i = s;
- if (i > 0 && RX_MATCH_UTF8(rx)) {
+ if (RX_MATCH_UTF8(rx)) {
const char * const b = RX_SUBBEG(rx);
if (b)
i = RX_SUBCOFFSET(rx) +
@@ -683,7 +683,7 @@ Perl_magic_regdatum_get(pTHX_ SV *sv, MAGIC *mg)
(U8*)(b-RX_SUBOFFSET(rx)+i));
}
- sv_setiv(sv, i);
+ sv_setuv(sv, i);
}
}
}