Skip to content

Commit

Permalink
PATCH: [perl #133899] panic in s///
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
khwilliamson committed Mar 7, 2019
1 parent 21c34e9 commit 70ecb4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions regexec.c
Expand Up @@ -4548,6 +4548,9 @@ S_setup_EXACTISH_ST_c1_c2(pTHX_ const regnode * const text_node, int *c1p,
case EXACTFU:
c2 = PL_fold_latin1[c1];
break;
case EXACTFU_ONLY8:
return FALSE;
NOT_REACHED; /* NOTREACHED */

default:
Perl_croak(aTHX_ "panic: Unexpected op %u", OP(text_node));
Expand Down
7 changes: 5 additions & 2 deletions t/re/subst.t
Expand Up @@ -11,7 +11,7 @@ BEGIN {
require './loc_tools.pl';
}

plan(tests => 276);
plan(tests => 277);

$_ = 'david';
$a = s/david/rules/r;
Expand Down Expand Up @@ -1174,5 +1174,8 @@ __EOF__
is $lines, 4, "RT #131930";
}

{ # [perl $133899], would panic


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

0 comments on commit 70ecb4b

Please sign in to comment.