summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-06 17:00:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-06 17:00:49 +0000
commit18b095192e336ba31465f4d3dab1ecc90871c3a9 (patch)
treebf4f20c33e798d5ca02aa71048c2cc3fc61a1807 /toke.c
parent9f060c8460ee304e7b59ae63ddd9ac34aa15b320 (diff)
downloadperl-18b095192e336ba31465f4d3dab1ecc90871c3a9.tar.gz
fix parse error on C<{ use strict }> and other constructs that
make the parser reenter while LEX_KNOWNEXT is active p4raw-id: //depot/perl@5004
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index e1eb817021..b9a12c41da 100644
--- a/toke.c
+++ b/toke.c
@@ -376,6 +376,15 @@ Perl_lex_start(pTHX_ SV *line)
SAVEI32(PL_lex_state);
SAVEVPTR(PL_lex_inpat);
SAVEI32(PL_lex_inwhat);
+ if (PL_lex_state == LEX_KNOWNEXT) {
+ I32 toke = PL_nexttoke;
+ while (--toke >= 0) {
+ SAVEI32(PL_nexttype[toke]);
+ SAVEVPTR(PL_nextval[toke]);
+ }
+ SAVEI32(PL_nexttoke);
+ PL_nexttoke = 0;
+ }
SAVECOPLINE(PL_curcop);
SAVEPPTR(PL_bufptr);
SAVEPPTR(PL_bufend);