X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=toke.c;h=de98e41b9e13e354a76b354b125aaa32f1ccc50e;hb=db4997f00d6b1ad267e4fec6a272e72e29719dd1;hp=0bbc1d91d1b19e4d6e7dd983765d8b7914958e59;hpb=295222340ad6893caa0a1c3479155f88ea290dc3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/toke.c b/toke.c index 0bbc1d9..de98e41 100644 --- a/toke.c +++ b/toke.c @@ -23,8 +23,7 @@ #define PERL_IN_TOKE_C #include "perl.h" -#define yychar (*PL_yycharp) -#define yylval (*PL_yylvalp) +#define yylval (PL_parser->yylval) static const char ident_too_long[] = "Identifier too long"; static const char commaless_variable_list[] = "comma-less variable list"; @@ -669,6 +668,10 @@ Perl_lex_start(pTHX_ SV *line) sv_catpvs(PL_linestr, "\n;"); } SvTEMP_off(PL_linestr); + /* PL_linestr needs to survive until end of scope, not just the next + FREETMPS. See changes 17505 and 17546 which fixed the symptoms only. */ + SvREFCNT_inc_simple_void_NN(PL_linestr); + SAVEFREESV(PL_linestr); PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = SvPVX(PL_linestr); PL_bufend = PL_bufptr + SvCUR(PL_linestr); PL_last_lop = PL_last_uni = NULL; @@ -5094,7 +5097,7 @@ Perl_yylex(pTHX) if (!tmp && PL_expect == XSTATE && d < PL_bufend && *d == ':' && *(d + 1) != ':') { s = d + 1; - yylval.pval = savepv(PL_tokenbuf); + yylval.pval = CopLABEL_alloc(PL_tokenbuf); CLINE; TOKEN(LABEL); } @@ -12381,6 +12384,7 @@ Perl_yyerror(pTHX_ const char *s) const char *context = NULL; int contlen = -1; SV *msg; + int yychar = PL_parser->yychar; if (!yychar || (yychar == ';' && !PL_rsfp)) where = "at EOF";