diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-06 08:34:15 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-06 08:34:15 -0800 |
commit | bbde7ba366f7e8eba62f86287e5267085c03d7dc (patch) | |
tree | 1ab08242972cda770004b9eaf694257ad59ae9a1 /t | |
parent | 70eec6488881c54307a924829e648b8abc9e8bc7 (diff) | |
download | perl-bbde7ba366f7e8eba62f86287e5267085c03d7dc.tar.gz |
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.
Diffstat (limited to 't')
-rw-r--r-- | t/op/eval.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/op/eval.t b/t/op/eval.t index f8e23e3295..78faa8545c 100644 --- a/t/op/eval.t +++ b/t/op/eval.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan(tests => 120); +plan(tests => 121); eval 'pass();'; @@ -586,3 +586,8 @@ EOP BEGIN { eval 'require re; import re "/x"' } ok "ab" =~ /a b/, 'eval does not localise %^H at run time'; } + +# The fix for perl #70151 caused an assertion failure that broke +# SNMP::Trapinfo, when toke.c finds no syntax errors but perly.y fails. +eval(q|""!=!~//|); +pass("phew! dodged the assertion after a parsing (not lexing) error"); |