summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2007-09-10 00:02:55 +0000
committerDave Mitchell <davem@fdisolutions.com>2007-09-10 00:02:55 +0000
commit0d3b281c4af2422da931f33692a278c5f05854cf (patch)
treec9233ce65e6a6e1f741db19d2bb044b4a42f9e0a /pad.c
parentcc4b8646f4297d1d601d9f445953d91eaef16779 (diff)
downloadperl-0d3b281c4af2422da931f33692a278c5f05854cf.tar.gz
when anon subs are cloned, the 'assign once only' flag should be
set for all state vars in the pad. (Nicholas worked up the same fix - spooky action at a distance!) p4raw-id: //depot/perl@31835
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pad.c b/pad.c
index 44fafb67ea..6e33495fcb 100644
--- a/pad.c
+++ b/pad.c
@@ -1517,6 +1517,9 @@ Perl_cv_clone(pTHX_ CV *proto)
else
sv = newSV(0);
SvPADMY_on(sv);
+ /* reset the 'assign only once' flag on each state var */
+ if (SvPAD_STATE(namesv))
+ SvPADSTALE_on(sv);
}
}
else if (IS_PADGV(ppad[ix]) || IS_PADCONST(ppad[ix])) {