summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2002-12-10 01:26:44 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-12-14 22:34:25 +0000
commit7dafbf5232bace07a044625a5a956b73da3928d5 (patch)
tree5042129d851b4706c4c22a7c67de6b3092bc08cb /sv.c
parent0412d5267fa2300f66eb4eb554e2af493b5e5b33 (diff)
downloadperl-7dafbf5232bace07a044625a5a956b73da3928d5.tar.gz
Proper fix for CvOUTSIDE weak refcounting
Message-ID: <20021210012644.A7843@fdgroup.com> p4raw-id: //depot/perl@18302
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sv.c b/sv.c
index 90a99dfd62..a21cedf50e 100644
--- a/sv.c
+++ b/sv.c
@@ -9602,12 +9602,11 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param)
CvDEPTH(dstr) = 0;
}
PAD_DUP(CvPADLIST(dstr), CvPADLIST(sstr), param);
- /* anon prototypes aren't refcounted */
- if (!CvANON(sstr) || CvCLONED(sstr))
- CvOUTSIDE(dstr) = cv_dup_inc(CvOUTSIDE(sstr), param);
- else
- CvOUTSIDE(dstr) = cv_dup(CvOUTSIDE(sstr), param);
- CvOUTSIDE_SEQ(dstr) = CvOUTSIDE_SEQ(sstr);
+ CvOUTSIDE_SEQ(dstr) = CvOUTSIDE_SEQ(sstr);
+ CvOUTSIDE(dstr) =
+ CvWEAKOUTSIDE(sstr)
+ ? cv_dup( CvOUTSIDE(sstr), param)
+ : cv_dup_inc(CvOUTSIDE(sstr), param);
CvFLAGS(dstr) = CvFLAGS(sstr);
CvFILE(dstr) = CvXSUB(sstr) ? CvFILE(sstr) : SAVEPV(CvFILE(sstr));
break;