From bbde7ba366f7e8eba62f86287e5267085c03d7dc Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 6 Dec 2011 08:34:15 -0800 Subject: =?UTF-8?q?Don=E2=80=99t=20LEAVE=5Fwith=5Fname("evalcomp")=20for?= =?UTF-8?q?=20syntax=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- t/op/eval.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 't') 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"); -- cgit v1.2.1