diff options
author | David Mitchell <davem@iabyn.com> | 2017-11-17 12:23:17 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-11-23 08:52:16 +0000 |
commit | d962625ff9208c2f683374d283f74eee759c2202 (patch) | |
tree | 31c972b1a35dffd0599590e25d7409bd4cd243fa /op.c | |
parent | ed34dca8117dd19b8eb9b3668892fd309157c5ad (diff) | |
download | perl-d962625ff9208c2f683374d283f74eee759c2202.tar.gz |
add OPpCONCAT_NESTED flag
This flag makes no functional difference to runtime (it merely flags
that an optimisation has been performed), but it will shortly be used to
assist Deparse and warnings.
OPf_STACKED, when set on a OP_CONCAT, normally indicates .=; but it
also gets set to optimise
$a . $b . $c
into
($a . $b) .= $c
so that the first concat's PADTMP (which holds the result of $a.$b) can be
reused. Set a flag in this case to help deparse and warn distinguish the
cases.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -10850,7 +10850,10 @@ Perl_ck_concat(pTHX_ OP *o) /* reuse the padtmp returned by the concat child */ if (kid->op_type == OP_CONCAT && !(kid->op_private & OPpTARGET_MY) && !(kUNOP->op_first->op_flags & OPf_MOD)) + { o->op_flags |= OPf_STACKED; + o->op_private |= OPpCONCAT_NESTED; + } return o; } |