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);
/* FALLTHROUGH */
case LEX_INTERPEND:
+ /* Treat state as LEX_NORMAL if we have no inner lexing scope.
+ XXX This hack can be removed if we stop setting PL_lex_state to
+ LEX_KNOWNEXT, as can the hack under LEX_INTREPCONCAT below. */
+ if (UNLIKELY(!PL_lex_inwhat)) {
+ PL_lex_state = LEX_NORMAL;
+ break;
+ }
+
if (PL_lex_dojoin) {
const U8 dojoin_was = PL_lex_dojoin;
PL_lex_dojoin = FALSE;
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);