summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-07-15 14:46:46 +0100
committerDavid Mitchell <davem@iabyn.com>2011-07-15 14:50:32 +0100
commit62bb6514085e5eddc42b4fdaf3713ccdb7f1da85 (patch)
tree87c66f67c8fe3b2244d0e1bd13c61c29b37ac9f3 /op.c
parent76d60a5393cb55f0d74c183769765dc7db58d81c (diff)
downloadperl-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/op.c b/op.c
index 7b129ac334..b0c09983de 100644
--- a/op.c
+++ b/op.c
@@ -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));