This particular syntax error, whittled down from ‘no if $] >= 5.17.4
warnings => "deprecated"’ (which contains a type), causes the parser
to try to free an op from the new sub (for the BEGIN block) after
freeing the new sub.
This happens on line 526 of perly.c. It should not be necessary for
the parser to free the op at this point, since after an error any ops
owned by incomplete subs’ slabs will be freed.
I’m leaving the other three instances of op_free in perly.c in place,
at least for now, since there are cases where the forced token stack
prevents ops from being freed when their subs are.
}
YYDSYMPRINTF ("Error: discarding", yytoken, &parser->yylval);
- if (yy_type_tab[yytoken] == toketype_opval)
- op_free(parser->yylval.opval);
parser->yychar = YYEMPTY;
}
# Checks if the parser behaves correctly in edge cases
# (including weird syntax errors)
-print "1..152\n";
+print "1..153\n";
sub failed {
my ($got, $expected, $name) = @_;
'literal -> [0] after an array subscript within ""');
}
+eval 'no if $] >= 5.17.4 warnings => "deprecated"';
+is 1,1, ' no crash for "no ... syntax error"';
+
+
# Add new tests HERE (above this line)
# bug #74022: Loop on characters in \p{OtherIDContinue}