summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-08-10 02:35:30 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-10 17:55:03 +0000
commit6cbc0cd1d96dba8bcda440e8ed6dde3e7b3a050b (patch)
tree4be6611e784ab204ab7dc71613919cb9d0d57131 /pad.c
parentd5a0d2f99e0b4c8cd215ae33ce31786e1b28a247 (diff)
downloadperl-6cbc0cd1d96dba8bcda440e8ed6dde3e7b3a050b.tar.gz
Re: [perl #23265] Nested anonymous subs
Message-ID: <20030810003530.GB6547@fdgroup.com> p4raw-id: //depot/perl@20597
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pad.c b/pad.c
index 90d99795a5..a121e5302e 100644
--- a/pad.c
+++ b/pad.c
@@ -258,9 +258,15 @@ Perl_pad_undef(pTHX_ CV* 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 (SvREFCNT(outercv)) {
+ CvOUTSIDE(innercv) = outercv;
+ SvREFCNT_inc(outercv);
+ }
+ else {
+ CvOUTSIDE(innercv) = Nullcv;
+ }
}
}
}