In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/66edcf79f81d47833f2be442966a5e90a223365f?hp=55b3980349c58171a77894903fd928262fb081f2>
- Log ----------------------------------------------------------------- commit 66edcf79f81d47833f2be442966a5e90a223365f Author: Father Chrysostomos <[email protected]> Date: Sun Mar 1 11:29:10 2015 -0800 [perl #123802] Assertion failure with "\L\L" This is a follow-up to f4460c6f7a. The check to see whether we are in a quote-like operator needs to come before the call to sublex_done, as sublex_done is just as problematic as doing SvIVX on a PV. (See 479ae48e22f for details on why.) Checking the type of PL_linestr is not a reliable way to see whether we are in a quote-like op, so use PL_in_what instead. M t/op/lex.t M toke.c commit de72f77898e4b8ed920f56af11895c098e8e44f7 Author: Father Chrysostomos <[email protected]> Date: Sun Mar 1 11:20:47 2015 -0800 t/op/lex.t: Correct bug num M t/op/lex.t ----------------------------------------------------------------------- Summary of changes: t/op/lex.t | 18 ++++++++++++++++-- toke.c | 10 +++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/t/op/lex.t b/t/op/lex.t index 06d069a..7785445 100644 --- a/t/op/lex.t +++ b/t/op/lex.t @@ -7,7 +7,7 @@ use warnings; BEGIN { chdir 't' if -d 't'; require './test.pl'; } -plan(tests => 21); +plan(tests => 23); { no warnings 'deprecated'; @@ -183,5 +183,19 @@ fresh_perl_is( 'syntax error at - line 1, near "{}"' . "\n" . "Execution of - aborted due to compilation errors.\n", { stderr => 1 }, - '/$0{}/ with no newline [perl #123712]' + '/$0{}/ with no newline [perl #123802]' +); +fresh_perl_is( + '"\L\L"', + 'syntax error at - line 1, near "\L\L"' . "\n" . + "Execution of - aborted due to compilation errors.\n", + { stderr => 1 }, + '"\L\L" with no newline [perl #123802]' +); +fresh_perl_is( + '<\L\L>', + 'syntax error at - line 1, near "\L\L"' . "\n" . + "Execution of - aborted due to compilation errors.\n", + { stderr => 1 }, + '<\L\L> with no newline [perl #123802]' ); diff --git a/toke.c b/toke.c index 33ae20f..f7ad00d 100644 --- a/toke.c +++ b/toke.c @@ -4552,17 +4552,17 @@ Perl_yylex(pTHX) Perl_croak(aTHX_ "panic: INTERPCONCAT, lex_brackets=%ld", (long) PL_lex_brackets); #endif - if (PL_bufptr == PL_bufend) - return REPORT(sublex_done()); - - /* Treat state as LEX_NORMAL if SvIVX is not valid on PL_linestr. + /* Treat state as LEX_NORMAL when not in an inner lexing scope. XXX This hack can be removed if we stop setting PL_lex_state to LEX_KNOWNEXT. */ - if (SvTYPE(PL_linestr) == SVt_PV) { + if (UNLIKELY(!PL_lex_inwhat)) { PL_lex_state = LEX_NORMAL; break; } + if (PL_bufptr == PL_bufend) + return REPORT(sublex_done()); + /* m'foo' still needs to be parsed for possible (?{...}) */ if (SvIVX(PL_linestr) == '\'' && !PL_lex_inpat) { SV *sv = newSVsv(PL_linestr); -- Perl5 Master Repository
