diff options
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -9864,8 +9864,13 @@ Perl_rvpv_dup(pTHX_ SV *dstr, SV *sstr, CLONE_PARAMS* param) /* Special case - not normally malloced for some reason */ if (SvREADONLY(sstr) && SvFAKE(sstr)) { /* A "shared" PV - clone it as unshared string */ - SvFAKE_off(dstr); - SvREADONLY_off(dstr); + if(!SvPADTMP(sstr)) { + /* However, some of them live in the pad + and they should not have these flags + turned off */ + SvFAKE_off(dstr); + SvREADONLY_off(dstr); + } SvPVX(dstr) = SAVEPVN(SvPVX(sstr), SvCUR(sstr)); } else { |