diff options
-rw-r--r-- | parser.h | 2 | ||||
-rw-r--r-- | toke.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -96,6 +96,8 @@ typedef struct yy_parser { I32 nexttoke; #endif + COP *saved_curcop; /* the previous PL_curcop */ + } yy_parser; @@ -671,11 +671,10 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, bool new_filter) /* on scope exit, free this parser and restore any outer one */ SAVEPARSER(parser); + parser->saved_curcop = PL_curcop; /* initialise lexer state */ - SAVECOPLINE(PL_curcop); - #ifdef PERL_MAD parser->curforce = -1; #else @@ -723,6 +722,7 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, bool new_filter) void Perl_parser_free(pTHX_ const yy_parser *parser) { + PL_curcop = parser->saved_curcop; SvREFCNT_dec(parser->linestr); if (parser->rsfp == PerlIO_stdin()) |