This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don’t LEAVE_with_name("evalcomp") for syntax errors
authorFather Chrysostomos <sprout@cpan.org>
Tue, 6 Dec 2011 16:34:15 +0000 (08:34 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 6 Dec 2011 16:34:15 +0000 (08:34 -0800)
commitbbde7ba366f7e8eba62f86287e5267085c03d7dc
tree1ab08242972cda770004b9eaf694257ad59ae9a1
parent70eec6488881c54307a924829e648b8abc9e8bc7
Don’t LEAVE_with_name("evalcomp") for syntax errors

In S_doeval, if yystatus == 0 but there have been parser errors, then
there will be an extra scope on the scope stack inside the evalcomp
scope, causing an assertion failure with LEAVE_with_name("evalcomp").

This can happen with eval(q|""!=!~//|), which is a reduced version of
an eval in SNMP::Trapinfo’s test suite.

Under non-debugging builds, everything would have worked anyway,
as the LEAVE_with_name("evalcomp") would have left the scope
inside evalcomp.

Since POPBLOCK pops away the savestack markers on the scope stack, it
is not actually necessary to do LEAVE_with_name("evalcomp") at all
when there is a syntax error.
pp_ctl.c
t/op/eval.t