diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-07-25 16:52:59 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-25 12:23:59 -0700 |
commit | a10eae290937db109954431d254a9a25287f190b (patch) | |
tree | b8f66ebeede31f9d4e58410160d8c467a414894d /mg.c | |
parent | 193941786d7a034dc215210b09aec6ee9257e10e (diff) | |
download | perl-a10eae290937db109954431d254a9a25287f190b.tar.gz |
Make @- and @+ return correct offsets beyond 2**31
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); } } } |