diff options
author | David Mitchell <davem@iabyn.com> | 2011-07-15 14:46:46 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-07-15 14:50:32 +0100 |
commit | 62bb6514085e5eddc42b4fdaf3713ccdb7f1da85 (patch) | |
tree | 87c66f67c8fe3b2244d0e1bd13c61c29b37ac9f3 /op.c | |
parent | 76d60a5393cb55f0d74c183769765dc7db58d81c (diff) | |
download | perl-62bb6514085e5eddc42b4fdaf3713ccdb7f1da85.tar.gz |
ensure SVs_PADTMP and SVs_PADTMP not both on
There's no reason for these two flags to ever both be on.
Fix the one place that was doing this, and assert that this never happens.
If this doesn't break anything, it opens the door to freeing a bit in
SvFLAGS. (woo hoo!)
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -9458,8 +9458,10 @@ Perl_rpeep(pTHX_ register OP *o) * for reference counts, sv_upgrade() etc. */ if (cSVOP->op_sv) { const PADOFFSET ix = pad_alloc(OP_CONST, SVs_PADTMP); - if (o->op_type != OP_METHOD_NAMED && SvPADTMP(cSVOPo->op_sv)) { - /* If op_sv is already a PADTMP then it is being used by + if (o->op_type != OP_METHOD_NAMED && + (SvPADTMP(cSVOPo->op_sv) || SvPADMY(cSVOPo->op_sv))) + { + /* If op_sv is already a PADTMP/MY then it is being used by * some pad, so make a copy. */ sv_setsv(PAD_SVl(ix),cSVOPo->op_sv); SvREADONLY_on(PAD_SVl(ix)); |