summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-04-22 16:26:40 +0100
committerDavid Mitchell <davem@iabyn.com>2015-04-22 16:26:40 +0100
commit82269f56dcc21a3e0ef8c48158a731daf5ceda25 (patch)
treed15a6a8403410ab8ff8a3ef27acb43e935f107a2 /op.c
parenta911bb254071ab7112c309e8245494c182ad9fe2 (diff)
downloadperl-82269f56dcc21a3e0ef8c48158a731daf5ceda25.tar.gz
RT #124207: assert failure in ck_stringify()
v5.21.4-416-g73f4c4f converted (among other things) stringify(join(...)) into just join(...). It asserted that the stringify didn't have any extra children, which it won't normally do, since in something like "@a-" the elements of the stringify get bundled up into a single tree of concats etc, and stringify just sees a single top-level join or concat or whatever. However during error recovery weird stuff can get left on the stack. So rather than asserting no more kids, skip the optimisation if there are more kids.
Diffstat (limited to 'op.c')
-rw-r--r--op.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/op.c b/op.c
index 4e8f5a4b56..afaae61c75 100644
--- a/op.c
+++ b/op.c
@@ -11118,11 +11118,11 @@ Perl_ck_stringify(pTHX_ OP *o)
{
OP * const kid = OpSIBLING(cUNOPo->op_first);
PERL_ARGS_ASSERT_CK_STRINGIFY;
- if (kid->op_type == OP_JOIN || kid->op_type == OP_QUOTEMETA
- || kid->op_type == OP_LC || kid->op_type == OP_LCFIRST
- || kid->op_type == OP_UC || kid->op_type == OP_UCFIRST)
+ if (( kid->op_type == OP_JOIN || kid->op_type == OP_QUOTEMETA
+ || kid->op_type == OP_LC || kid->op_type == OP_LCFIRST
+ || kid->op_type == OP_UC || kid->op_type == OP_UCFIRST)
+ && !OpHAS_SIBLING(kid)) /* syntax errs can leave extra children */
{
- assert(!OpHAS_SIBLING(kid));
op_sibling_splice(o, cUNOPo->op_first, -1, NULL);
op_free(o);
return kid;