This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tentative fix for RT#125350 - AFL detected crash.
authorShlomi Fish <shlomif@shlomifish.org>
Fri, 4 Sep 2015 19:26:12 +0000 (22:26 +0300)
committerJames E Keenan <jkeenan@cpan.org>
Thu, 17 Sep 2015 22:42:29 +0000 (18:42 -0400)
perly.c
t/base/lex.t

diff --git a/perly.c b/perly.c
index abb4d4e..91b4c79 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -213,7 +213,7 @@ S_clear_yystack(pTHX_  const yy_parser *parser)
        if (yy_type_tab[yystos[ps->state]] == toketype_opval
            && ps->val.opval)
        {
-           if (ps->compcv != PL_compcv) {
+           if (ps->compcv && (ps->compcv != PL_compcv)) {
                PL_compcv = ps->compcv;
                PAD_SET_CUR_NOSAVE(CvPADLIST(PL_compcv), 1);
                PL_comppad_name = PadlistNAMES(CvPADLIST(PL_compcv));
index 47c6be8..981b2e5 100644 (file)
@@ -1,6 +1,6 @@
 #!./perl
 
-print "1..103\n";
+print "1..104\n";
 
 $x = 'x';
 
@@ -517,3 +517,9 @@ eval q|s##[}#e|;
  eval '0; qq{@{sub{]]}}}}}';
  print "ok $test - 124385\n"; $test++;
 }
+
+{
+ # Used to crash [perl #125350]
+ eval ('qq{@{[0}*sub{]]}}}=sub{0' . "\c[");
+ print "ok $test - 125350\n"; $test++;
+}