diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-12 14:33:01 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-12 14:33:01 +0000 |
commit | fda9478484acad719a798cc07d7a2ec14093628d (patch) | |
tree | 1aacae21afbe3bf79b06ddf6eefca8ff2dfb409c /pad.c | |
parent | a2fa79ff09c6e833b390c6a5d5fb10ed23b1cac1 (diff) | |
download | perl-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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])); } |