diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2007-06-22 23:46:36 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2007-06-22 23:46:36 +0000 |
commit | efa785391fea9e6aff4c999b27ad62b7d8f9ea99 (patch) | |
tree | e3d0ba3c1dc82782a9efac32a4b9858418fdd3ca /pad.c | |
parent | ebbf13f2d6b71e644ff7236eeae62f89a124f231 (diff) | |
download | perl-efa785391fea9e6aff4c999b27ad62b7d8f9ea99.tar.gz |
safely handle cloning a stale lexical var
This code:
my $x if ...; sub { $x}
could attempt to clone $x even if $x is stale.
p4raw-id: //depot/perl@31447
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1501,8 +1501,8 @@ Perl_cv_clone(pTHX_ CV *proto) "Variable \"%s\" is not available", SvPVX_const(namesv)); sv = NULL; } - else { - assert(!SvPADSTALE(sv)); + /* 'my $x if $y' can leave $x stale even in an active sub */ + else if (!SvPADSTALE(sv)) { SvREFCNT_inc_simple_void_NN(sv); } } |