summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-04-27 14:02:38 +0100
committerDavid Mitchell <davem@iabyn.com>2015-04-27 14:04:07 +0100
commit05039abd64c611f39e792c9c6546c4795fb96ada (patch)
treea8138a08d78bb1db5e572328decaadf239661d17 /op.c
parent257844b92d3c10f7e307f63208d703bf01f713fb (diff)
downloadperl-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.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/op.c b/op.c
index 1581f45811..91ab762328 100644
--- a/op.c
+++ b/op.c
@@ -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