diff options
author | Father Chrysostomos <sprout@cpan.org> | 2015-03-01 18:11:23 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2015-03-01 18:11:23 -0800 |
commit | ce7c414ee71d82955c799dca38981337cdf77b42 (patch) | |
tree | 107d3873e4dcb97556b659db88ec275641e7a470 /t/base | |
parent | 57db463f603fcd67bf53a35aa482bb24aa2c6950 (diff) | |
download | perl-ce7c414ee71d82955c799dca38981337cdf77b42.tar.gz |
[perl #123955] Fix assert fail with 0 s/// in quotes
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.
Diffstat (limited to 't/base')
-rw-r--r-- | t/base/lex.t | 3 |
1 files changed, 2 insertions, 1 deletions
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] { |