summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-12 14:33:01 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-12 14:33:01 +0000
commitfda9478484acad719a798cc07d7a2ec14093628d (patch)
tree1aacae21afbe3bf79b06ddf6eefca8ff2dfb409c /pad.c
parenta2fa79ff09c6e833b390c6a5d5fb10ed23b1cac1 (diff)
downloadperl-fda9478484acad719a798cc07d7a2ec14093628d.tar.gz
Like fake scalars, state variables shouldn't get new pad entries
at each recursion, in order to be truly stateful. (bug #41789) p4raw-id: //depot/perl@30548
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pad.c b/pad.c
index f565ce2918..8560d9aa47 100644
--- a/pad.c
+++ b/pad.c
@@ -1619,7 +1619,10 @@ Perl_pad_push(pTHX_ PADLIST *padlist, int depth)
for ( ;ix > 0; ix--) {
if (names_fill >= ix && names[ix] != &PL_sv_undef) {
const char sigil = SvPVX_const(names[ix])[0];
- if ((SvFLAGS(names[ix]) & SVf_FAKE) || sigil == '&') {
+ if ((SvFLAGS(names[ix]) & SVf_FAKE)
+ || (SvFLAGS(names[ix]) & SVpad_STATE)
+ || sigil == '&')
+ {
/* outer lexical or anon code */
av_store(newpad, ix, SvREFCNT_inc(oldpad[ix]));
}