From: Nicholas Clark Date: Sun, 12 Jun 2005 23:40:55 +0000 (+0000) Subject: Clone all shared string PVs as shared string PVs (now that we can do X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef10be658e6b7a3f595b5123a303a889a3e64565;p=p5sagit%2Fp5-mst-13.2.git Clone all shared string PVs as shared string PVs (now that we can do it very efficiently) p4raw-id: //depot/perl@24814 --- diff --git a/sv.c b/sv.c index b565057..9f2049e 100644 --- a/sv.c +++ b/sv.c @@ -10740,22 +10740,11 @@ Perl_rvpv_dup(pTHX_ SV *dstr, SV *sstr, CLONE_PARAMS* param) } else { /* Special case - not normally malloced for some reason */ - if (SvREADONLY(sstr) && SvFAKE(sstr)) { - /* A "shared" PV - clone it as unshared string */ - if(SvPADTMP(sstr)) { - /* However, some of them live in the pad - and they should not have these flags - turned off */ - - SvPV_set(dstr, - HEK_KEY(hek_dup(SvSHARED_HEK_FROM_PV(SvPVX_const(sstr)), - param))); - } else { - - SvPV_set(dstr, SAVEPVN(SvPVX_const(sstr), SvCUR(sstr))); - SvFAKE_off(dstr); - SvREADONLY_off(dstr); - } + if ((SvREADONLY(sstr) && SvFAKE(sstr))) { + /* A "shared" PV - clone it as "shared" PV */ + SvPV_set(dstr, + HEK_KEY(hek_dup(SvSHARED_HEK_FROM_PV(SvPVX_const(sstr)), + param))); } else { /* Some other special case - random pointer */