S_maybe_multiconcat(): use OPpCONCAT_NESTED flag
authorDavid Mitchell <davem@iabyn.com>
Mon, 11 Dec 2017 12:02:57 +0000 (12:02 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 11 Dec 2017 12:10:07 +0000 (12:10 +0000)
RT # 132554

I recently added the OPpCONCAT_NESTED flag to distinguish between

    $a .= ...

and
    $a . $b . $c

where the latter has been optimised into

    ($a . $b) .= $c

Update S_maybe_multiconcat() to recognise this new flag.
It was failing an assert on this code:

    ./perl -e 'H.-w.w.=0'

op.c

diff --git a/op.c b/op.c
index 0f7ee62..1d31928 100644 (file)
--- a/op.c
+++ b/op.c
@@ -2715,7 +2715,9 @@ S_maybe_multiconcat(pTHX_ OP *o)
     }
     else if (   topop->op_type == OP_CONCAT
              && (topop->op_flags & OPf_STACKED)
-             && (cUNOPo->op_first->op_flags & OPf_MOD))
+             && (cUNOPo->op_first->op_flags & OPf_MOD)
+             && (!(topop->op_private & OPpCONCAT_NESTED))
+            )
     {
         /* expr .= ..... */