In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/05039abd64c611f39e792c9c6546c4795fb96ada?hp=257844b92d3c10f7e307f63208d703bf01f713fb>
- Log ----------------------------------------------------------------- commit 05039abd64c611f39e792c9c6546c4795fb96ada Author: David Mitchell <[email protected]> Date: Mon Apr 27 14:02:38 2015 +0100 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. ----------------------------------------------------------------------- Summary of changes: op.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/op.c b/op.c index 1581f45..91ab762 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 -- Perl5 Master Repository
