From: Hugo van der Sanden Date: Thu, 29 Jan 2004 15:12:12 +0000 (+0000) Subject: Re: [perl #25269] panic: pp_match start/end pointers in m/^(?=.*(a)).*(bc)/ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=289555fe151ab6b9c4f788fbf1bf5f04fe169ea7;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #25269] panic: pp_match start/end pointers in m/^(?=.*(a)).*(bc)/ Message-Id: <200401291512.i0TFCCr23736@zen.crypt.org> p4raw-id: //depot/perl@22245 --- diff --git a/pp_hot.c b/pp_hot.c index 1874a14..1dffe94 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1312,10 +1312,10 @@ play_it_again: /*SUPPRESS 560*/ if ((rx->startp[i] != -1) && rx->endp[i] != -1 ) { len = rx->endp[i] - rx->startp[i]; + s = rx->startp[i] + truebase; if (rx->endp[i] < 0 || rx->startp[i] < 0 || len < 0 || len > strend - s) DIE(aTHX_ "panic: pp_match start/end pointers"); - s = rx->startp[i] + truebase; sv_setpvn(*SP, s, len); if (DO_UTF8(TARG) && is_utf8_string((U8*)s, len)) SvUTF8_on(*SP); diff --git a/t/op/pat.t b/t/op/pat.t index 7757c40..2348c33 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..1055\n"; +print "1..1056\n"; BEGIN { chdir 't' if -d 't'; @@ -3262,5 +3262,11 @@ for (120 .. 130) { } } -# last test 1055 +# perl #25269: panic: pp_match start/end pointers +ok("a-bc" eq eval { + my($x, $y) = "bca" =~ /^(?=.*(a)).*(bc)/; + "$x-$y"; +}, 'captures can move backwards in string'); + +# last test 1056