diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2006-01-03 02:20:28 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2006-01-03 02:20:28 +0000 |
commit | 34394ecd06e704e9000dad1c98dea7dea737c4ea (patch) | |
tree | 4f39da0d9cb4be2c90daf0b7fbcbb697f9d49e48 /sv.c | |
parent | 679c1196bc547e94f05d35e070242e24492ec832 (diff) | |
download | perl-34394ecd06e704e9000dad1c98dea7dea737c4ea.tar.gz |
ithreads: SVs that were only on the tmps stack leaked
p4raw-id: //depot/perl@26591
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -10767,6 +10767,20 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, else { init_stacks(); ENTER; /* perl_destruct() wants to LEAVE; */ + + /* although we're not duplicating the tmps stack, we should still + * add entries for any SVs on the tmps stack that got cloned by a + * non-refcount means (eg a temp in @_); otherwise they will be + * orphaned + */ + for (i = 0; i<= proto_perl->Ttmps_ix; i++) { + SV *nsv = (SV*)ptr_table_fetch(PL_ptr_table, + proto_perl->Ttmps_stack[i]); + if (nsv && !SvREFCNT(nsv)) { + EXTEND_MORTAL(1); + PL_tmps_stack[++PL_tmps_ix] = SvREFCNT_inc(nsv); + } + } } PL_start_env = proto_perl->Tstart_env; /* XXXXXX */ |