diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2008-01-09 01:50:38 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2008-01-09 01:50:38 +0000 |
commit | 33894c1aa3e715f48f9d6f591dc779d058e6329b (patch) | |
tree | 0ce1474cb8c46466988d185abbf29b26105038b7 /pad.c | |
parent | 1f0bbb56807074c4a1da6fa28c421d1070fd4fff (diff) | |
download | perl-33894c1aa3e715f48f9d6f591dc779d058e6329b.tar.gz |
change #31447 was wrong. Really handle cloning a stale lexical var
p4raw-link: @31447 on //depot/perl: efa785391fea9e6aff4c999b27ad62b7d8f9ea99
p4raw-id: //depot/perl@32906
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1494,17 +1494,17 @@ Perl_cv_clone(pTHX_ CV *proto) if (SvFAKE(namesv)) { /* lexical from outside? */ sv = outpad[PARENT_PAD_INDEX(namesv)]; assert(sv); - /* formats may have an inactive parent */ - if (SvTYPE(proto) == SVt_PVFM && SvPADSTALE(sv)) { + /* formats may have an inactive parent, + while my $x if $false can leave an active var marked as + stale */ + if (SvPADSTALE(sv)) { if (ckWARN(WARN_CLOSURE)) Perl_warner(aTHX_ packWARN(WARN_CLOSURE), "Variable \"%s\" is not available", SvPVX_const(namesv)); sv = NULL; } - /* 'my $x if $y' can leave $x stale even in an active sub */ - else if (!SvPADSTALE(sv)) { + else SvREFCNT_inc_simple_void_NN(sv); - } } if (!sv) { const char sigil = SvPVX_const(namesv)[0]; |