The fix is to disable Perl_block_start and Perl_block_end
when the yacc parser has encountered errors. This prevents
corruption of the internal stack, at the expense of correctness,
but this doesn't matter as the code is unparseable anyway.
p4raw-id: //depot/perl@18166
Perl_block_start(pTHX_ int full)
{
int retval = PL_savestack_ix;
+ /* If there were syntax errors, don't try to start a block */
+ if (PL_yynerrs) return retval;
pad_block_start(full);
SAVEHINTS();
int needblockscope = PL_hints & HINT_BLOCK_SCOPE;
line_t copline = PL_copline;
OP* retval = scalarseq(seq);
+ /* If there were syntax errors, don't try to close a block */
+ if (PL_yynerrs) return retval;
if (!seq) {
/* scalarseq() gave us an OP_STUB */
retval->op_flags |= OPf_PARENS;