diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-12 08:09:43 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-12 08:09:43 +0000 |
commit | 9d1ce744c6b1f6545853185bcc1688e9343cccff (patch) | |
tree | a6b343b669974df9928ac38cc1ab2dea5d266f30 /pad.c | |
parent | b7056d9c698177a62c525b2c6e1f5368fe56e6c5 (diff) | |
download | perl-9d1ce744c6b1f6545853185bcc1688e9343cccff.tar.gz |
A new try from Dave Mitchell for [perl #23265].
p4raw-id: //depot/perl@20631
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -257,11 +257,19 @@ Perl_pad_undef(pTHX_ CV* cv) && CvOUTSIDE(innercv) == cv) { assert(CvWEAKOUTSIDE(innercv)); - CvWEAKOUTSIDE_off(innercv); - CvOUTSIDE(innercv) = outercv; - CvOUTSIDE_SEQ(innercv) = seq; - SvREFCNT_inc(outercv); + /* don't relink to grandfather if he's being freed */ + if (outercv && SvREFCNT(outercv)) { + CvWEAKOUTSIDE_off(innercv); + CvOUTSIDE(innercv) = outercv; + CvOUTSIDE_SEQ(innercv) = seq; + SvREFCNT_inc(outercv); + } + else { + CvOUTSIDE(innercv) = Nullcv; + } + } + } } } |