From ce7c414ee71d82955c799dca38981337cdf77b42 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 1 Mar 2015 18:11:23 -0800 Subject: [perl #123955] Fix assert fail with 0 s/// in quotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is related to bug #123617 and is a follow-up to eabab8bcc. This code: "@0{0s 000";eval"$" begins tokenisation as follows: stringify ( join ( $ " , @ 0 { 0 subst When seeing the subst after the 0, the parser discards many tokens and we end up at the ; outside the quotes. Since PL_lex_stuff (the temporary spot for storing the contents of a quote-like operator) is localised as of eabab8bcc, we end up with just PL_sublex_info.repl (the temporary spot for storing the replacement part) set. Since it is still set when we get to the next double- quote, it is treated as a two-part quote-like operator, like y or s. That can’t happen, and we have assertions to make sure of it. We need to localise PL_sublex_info.repl as well, so it gets freed properly when scopes are popped after an error. --- t/base/lex.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't/base/lex.t') diff --git a/t/base/lex.t b/t/base/lex.t index fdeafb12fa..6a8ac613f5 100644 --- a/t/base/lex.t +++ b/t/base/lex.t @@ -486,8 +486,9 @@ print "ok $test - map{sub :lvalue...}\n"; $test++; # Used to crash [perl #123711] 0-5x-l{0}; -# Used to fail an assertion [perl #123617] +# Used to fail an assertion [perl #123617] [perl #123955] eval '"$a{ 1 m// }"; //'; +eval '"@0{0s 000";eval"$"'; # Pending token stack overflow [perl #123677] { -- cgit v1.2.1