diff options
author | David Mitchell <davem@iabyn.com> | 2014-10-30 10:28:06 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-12-07 09:07:30 +0000 |
commit | b3e29a8d61624b715f53d94326515e9d3a0b205f (patch) | |
tree | 9ff6a93f1c4c23b2b2dfcfa6d65637b1f8b5eeb9 /op.c | |
parent | f9b02e4247d646ae39a50c5d47ab065a13205c07 (diff) | |
download | perl-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 */ |