summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@covalent.net>2001-08-04 04:09:37 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2001-08-04 17:31:06 +0000
commit01485f8b60f6cb9da6ceaaafc3abd52c6f690081 (patch)
tree5f71cc4f2573727eb35514aa07985fe6a57624c7 /sv.c
parentf33976b4825a1f900bb28e78ad0509286ad2ffe5 (diff)
downloadperl-01485f8b60f6cb9da6ceaaafc3abd52c6f690081.tar.gz
Re: [patch] rid "Scalars leaked" from perl_clone
Message-ID: <Pine.LNX.4.21.0108041102390.23972-100000@mako.covalent.net> p4raw-id: //depot/perl@11576
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 5269abac35..2eacc331a8 100644
--- a/sv.c
+++ b/sv.c
@@ -9090,6 +9090,11 @@ Perl_sv_dup(pTHX_ SV *sstr, clone_params* param)
CvROOT(dstr) = OpREFCNT_inc(CvROOT(sstr));
CvXSUB(dstr) = CvXSUB(sstr);
CvXSUBANY(dstr) = CvXSUBANY(sstr);
+ if (CvCONST(sstr)) {
+ CvXSUBANY(dstr).any_ptr = GvUNIQUE(CvGV(sstr)) ?
+ SvREFCNT_inc(CvXSUBANY(sstr).any_ptr) :
+ sv_dup_inc(CvXSUBANY(sstr).any_ptr, param);
+ }
CvGV(dstr) = gv_dup(CvGV(sstr), param);
if (param->flags & CLONEf_COPY_STACKS) {
CvDEPTH(dstr) = CvDEPTH(sstr);