diff options
author | David Mitchell <davem@iabyn.com> | 2014-02-28 19:25:51 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-02-28 19:39:23 +0000 |
commit | 9af159903dbf2799f16d8b83e8e556583aabd3e2 (patch) | |
tree | d0538941c0f01aae6d885e49b66ae72db4759520 | |
parent | 7532eaaef8da50c2ccee274667a2fa4a3dd6e349 (diff) | |
download | perl-9af159903dbf2799f16d8b83e8e556583aabd3e2.tar.gz |
SAVEt_CLEARSV: only clear-in-place if RC==1
Currently it takes the 'clear-in-place' branch on lexical vars if
the ref count is <= 1. However, RC < 1 is a "should never happen"
condition, so rather than keeping that damaged var, take the other branch,
which will call SvREFCNT_dec() on it, which will Do the Right Thing
(like emitting a warning).
-rw-r--r-- | scope.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1039,7 +1039,7 @@ Perl_leave_scope(pTHX_ I32 base) assert(SvPADMY(sv)); /* Can clear pad variable in place? */ - if (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) { + if (SvREFCNT(sv) == 1 && !SvOBJECT(sv)) { /* these flags are the union of all the relevant flags * in the individual conditions within */ |