summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2014-10-30 10:28:06 +0000
committerDavid Mitchell <davem@iabyn.com>2014-12-07 09:07:30 +0000
commitb3e29a8d61624b715f53d94326515e9d3a0b205f (patch)
tree9ff6a93f1c4c23b2b2dfcfa6d65637b1f8b5eeb9 /op.c
parentf9b02e4247d646ae39a50c5d47ab065a13205c07 (diff)
downloadperl-b3e29a8d61624b715f53d94326515e9d3a0b205f.tar.gz
Perl_op_sibling_splice(): update OPf_KIDS
Previously this function didn't update OPf_KIDS when altering the children. This was only safe as long as the count of kids didn't transition between 0 and !0.
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/op.c b/op.c
index a045e55d3c..a95c6f40e9 100644
--- a/op.c
+++ b/op.c
@@ -1190,8 +1190,13 @@ Perl_op_sibling_splice(OP *parent, OP *start, int del_count, OP* insert)
OP_SIBLING_set(start, insert);
start->op_lastsib = insert ? 0 : 1;
}
- else
+ else {
cLISTOPx(parent)->op_first = insert;
+ if (insert)
+ parent->op_flags |= OPf_KIDS;
+ else
+ parent->op_flags &= ~OPf_KIDS;
+ }
if (!rest) {
/* update op_last etc */