This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #125351) abort parsing if parse errors happen in a sub lex
authorTony Cook <tony@develop-help.com>
Tue, 30 Jan 2018 05:40:53 +0000 (16:40 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 5 Feb 2018 22:13:31 +0000 (09:13 +1100)
commitbb4e4c3869d9fb6ee5bddd820c2a373601ecc310
treecf7b4bcfcfc4d20c184e06a6dea9fff9bf8aed8b
parent4bfb5532d393d56b18d13bc19f70f6f7a64ae781
(perl #125351) abort parsing if parse errors happen in a sub lex

We've had a few reports of segmentation faults and other misbehaviour
when sub-parsing, such as within interpolated expressions, fails.

This change aborts compilation if anything complex enough to not be
parsed by the lexer is compiled in a sub-parse *and* an error
occurs within the sub-parse.

An earlier version of this patch failed on simpler expressions,
which caused many test failures, which this version doesn't (which may
just mean we need more tests...)
parser.h
t/base/lex.t
toke.c