From: Doug MacEachern Date: Sat, 4 Aug 2001 11:09:37 +0000 (-0700) Subject: Re: [patch] rid "Scalars leaked" from perl_clone X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01485f8b60f6cb9da6ceaaafc3abd52c6f690081;p=p5sagit%2Fp5-mst-13.2.git Re: [patch] rid "Scalars leaked" from perl_clone Message-ID: p4raw-id: //depot/perl@11576 --- 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);