From 01485f8b60f6cb9da6ceaaafc3abd52c6f690081 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 4 Aug 2001 04:09:37 -0700 Subject: [PATCH] Re: [patch] rid "Scalars leaked" from perl_clone Message-ID: p4raw-id: //depot/perl@11576 --- sv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sv.c b/sv.c index 5269aba..2eacc33 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); -- 2.7.4