From: Nicholas Clark Date: Sun, 31 Dec 2006 12:31:09 +0000 (+0000) Subject: As freeing up PL_linestr is now done via the scope stack, there's no X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6c5ce11d20b3449b2088bdfd556ac149927f51e9;p=p5sagit%2Fp5-mst-13.2.git As freeing up PL_linestr is now done via the scope stack, there's no need to make any temporary varariable a mortal, and waste effort on the temp stack (not) clearing it up. p4raw-id: //depot/perl@29644 --- diff --git a/toke.c b/toke.c index de98e41..eaa7e6b 100644 --- a/toke.c +++ b/toke.c @@ -660,17 +660,18 @@ Perl_lex_start(pTHX_ SV *line) #endif PL_lex_inwhat = 0; PL_sublex_info.sub_inwhat = 0; - PL_linestr = line; - s = SvPV_const(PL_linestr, len); - if (SvREADONLY(PL_linestr) || !len || s[len-1] != ';') { - PL_linestr = sv_2mortal(len ? newSVsv(PL_linestr) : newSVpvn(s, 0)); + s = SvPV_const(line, len); + if (SvREADONLY(line) || !len || s[len-1] != ';') { + PL_linestr = len ? newSVsv(line) : newSVpvn(s, 0); if (!len || s[len-1] != ';') sv_catpvs(PL_linestr, "\n;"); + } else { + SvTEMP_off(line); + SvREFCNT_inc_simple_void_NN(line); + PL_linestr = line; } - 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);