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 /toke.c | |
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 'toke.c')
-rw-r--r-- | toke.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2381,6 +2381,7 @@ S_sublex_push(pTHX) popping. We must not have a PL_lex_stuff value left dangling, as that breaks assumptions elsewhere. See bug #123617. */ SAVEGENERICSV(PL_lex_stuff); + SAVEGENERICSV(PL_sublex_info.repl); PL_bufend = PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart = SvPVX(PL_linestr); |