diff options
author | David Mitchell <davem@iabyn.com> | 2015-04-27 14:02:38 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2015-04-27 14:04:07 +0100 |
commit | 05039abd64c611f39e792c9c6546c4795fb96ada (patch) | |
tree | a8138a08d78bb1db5e572328decaadf239661d17 /op.c | |
parent | 257844b92d3c10f7e307f63208d703bf01f713fb (diff) | |
download | perl-05039abd64c611f39e792c9c6546c4795fb96ada.tar.gz |
op_sibling_splice(): handle custom ops
op_sibling_splice() decides whether a parent op has an op_last field
that needs updating based on the op's class. However, it it didn't
handle OP_CUSTOM ops.
Spotted by Zefram.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1325,10 +1325,19 @@ Perl_op_sibling_splice(OP *parent, OP *start, int del_count, OP* insert) if (!parent) goto no_parent; + /* ought to use OP_CLASS(parent) here, but that can't handle + * ex-foo OP_NULL ops. Also note that XopENTRYCUSTOM() can't + * either */ type = parent->op_type; - if (type == OP_NULL) - type = parent->op_targ; - type = PL_opargs[type] & OA_CLASS_MASK; + if (type == OP_CUSTOM) { + dTHX; + type = XopENTRYCUSTOM(parent, xop_class); + } + else { + if (type == OP_NULL) + type = parent->op_targ; + type = PL_opargs[type] & OA_CLASS_MASK; + } lastop = last_ins ? last_ins : start ? start : NULL; if ( type == OA_BINOP |