summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2003-04-17 17:31:52 +0000
committerArtur Bergman <sky@nanisky.com>2003-04-17 17:31:52 +0000
commit5e6160dc45a74849468013747b2649ba17c9faab (patch)
treefab17dd1c975d89d17d72614ff43b481e35c1952 /sv.c
parent7a8675bc7c355f062650f283996d25b47996007d (diff)
downloadperl-5e6160dc45a74849468013747b2649ba17c9faab.tar.gz
Extreme Voodoo programming, by not pinching the SV if it is a
PADTMP it happily keeps it's value later on! p4raw-id: //depot/perl@19254
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index 69cb3bc701..6a4dcf11bd 100644
--- a/sv.c
+++ b/sv.c
@@ -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 {