summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2006-12-29 00:08:35 +0000
committerDave Mitchell <davem@fdisolutions.com>2006-12-29 00:08:35 +0000
commit7e5d8ed22a9e0983529873e07602c1b147b8b5b8 (patch)
tree4c7e2c13fcea923635ea9c6d9fbb45471e33ba95 /op.c
parent44a10c71f5d5adc63a15c1d8fb5e8b72de48836f (diff)
downloadperl-7e5d8ed22a9e0983529873e07602c1b147b8b5b8.tar.gz
further fix for #29543: fix parser leaks caused by croaking
p4raw-id: //depot/perl@29636
Diffstat (limited to 'op.c')
-rw-r--r--op.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/op.c b/op.c
index ecff57fe16..6422ff1e4a 100644
--- a/op.c
+++ b/op.c
@@ -2726,6 +2726,7 @@ Perl_newOP(pTHX_ I32 type, I32 flags)
o->op_flags = (U8)flags;
o->op_latefree = 0;
o->op_latefreed = 0;
+ o->op_attached = 0;
o->op_next = o;
o->op_private = (U8)(0 | (flags >> 8));
@@ -5323,6 +5324,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
if (CvLVALUE(cv)) {
CvROOT(cv) = newUNOP(OP_LEAVESUBLV, 0,
mod(scalarseq(block), OP_LEAVESUBLV));
+ block->op_attached = 1;
}
else {
/* This makes sub {}; work as expected. */
@@ -5335,6 +5337,8 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
#endif
block = newblock;
}
+ else
+ block->op_attached = 1;
CvROOT(cv) = newUNOP(OP_LEAVESUB, 0, scalarseq(block));
}
CvROOT(cv)->op_private |= OPpREFCOUNTED;