summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-31 12:07:37 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-31 12:07:37 +0000
commitdb4997f00d6b1ad267e4fec6a272e72e29719dd1 (patch)
tree9b20cf182c515f776a2512797f6b6f5a5b670b78 /toke.c
parent1cb9cd5016282146cd55ab904078500def5f5754 (diff)
downloadperl-db4997f00d6b1ad267e4fec6a272e72e29719dd1.tar.gz
PL_linestr needs to survive until the end of scope, not just the next
FREETMPS. Fixes the underlying cause of the thread cloning SEGV reported in http://www.nntp.perl.org/group/perl.perl5.porters/63123 p4raw-id: //depot/perl@29643
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 89d8f0b532..de98e41b9e 100644
--- a/toke.c
+++ b/toke.c
@@ -668,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;