New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: pp_match start/end pointers in m/^(?=.*(a)).*(bc)/ #7066
Comments
From wolf-dietrich.moeller@siemens.comThe following program dies in command line and as cgi under apache 2.0.48 on
|
From @hvdsMoeller Wolf-Dietrich (via RT) <perlbug-followup@perl.org> wrote: Thanks for the report, I can confirm that this bug still exists in the The bug is specific to matches in list context, so if needs be you can It will go wrong specifically if you have two consecutive captures The problem occurs because the list construction uses the wrong Hugo Inline Patch--- pp_hot.c.old Tue Jan 20 00:36:33 2004
+++ pp_hot.c Thu Jan 29 15:02:05 2004
@@ -1312,10 +1312,10 @@
/*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);
--- t/op/pat.t.old Thu Jan 1 19:40:59 2004
+++ t/op/pat.t Thu Jan 29 14:57:42 2004
@@ -6,7 +6,7 @@
$| = 1;
-print "1..1055\n";
+print "1..1056\n";
BEGIN {
chdir 't' if -d 't';
@@ -3262,5 +3262,11 @@
}
}
-# 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
|
The RT System itself - Status changed from 'new' to 'open' |
@rgs - Status changed from 'open' to 'resolved' |
From @rgshv@crypt.org wrote:
Thanks, applied as #22245. |
Migrated from rt.perl.org#25269 (status was 'resolved')
Searchable as RT25269$
The text was updated successfully, but these errors were encountered: