Skip to content

Commit 70ecb4b

Browse files
committed
PATCH: [perl #133899] panic in s///
Thanks for finding this bug, and the others you've been finding. A new regnode was added, but this function was not updated to account for that. I've now checked all the other new regnodes in 5.29 and this was the only missing one.
1 parent 21c34e9 commit 70ecb4b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

regexec.c

+3
Original file line numberDiff line numberDiff line change
@@ -4548,6 +4548,9 @@ S_setup_EXACTISH_ST_c1_c2(pTHX_ const regnode * const text_node, int *c1p,
45484548
case EXACTFU:
45494549
c2 = PL_fold_latin1[c1];
45504550
break;
4551+
case EXACTFU_ONLY8:
4552+
return FALSE;
4553+
NOT_REACHED; /* NOTREACHED */
45514554

45524555
default:
45534556
Perl_croak(aTHX_ "panic: Unexpected op %u", OP(text_node));

t/re/subst.t

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ BEGIN {
1111
require './loc_tools.pl';
1212
}
1313

14-
plan(tests => 276);
14+
plan(tests => 277);
1515

1616
$_ = 'david';
1717
$a = s/david/rules/r;
@@ -1174,5 +1174,8 @@ __EOF__
11741174
is $lines, 4, "RT #131930";
11751175
}
11761176

1177+
{ # [perl $133899], would panic
11771178

1178-
1179+
fresh_perl_is('my $a = "ha"; $a =~ s!|0?h\x{300}(?{})!!gi', "", {},
1180+
"[perl #133899] s!|0?h\\x{300}(?{})!!gi panics");
1181+
}

0 commit comments

Comments
 (0)