diff options
author | David Mitchell <davem@iabyn.com> | 2017-12-19 12:09:15 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-12-19 15:15:02 +0000 |
commit | c352ee5f96ca31651e1bac4e2f72702d961e700c (patch) | |
tree | ca81913637928c3b6a49c301b8ea5469a926a673 /pp_hot.c | |
parent | 159675014fd98cba9a4bb64961c8cec02dfec87d (diff) | |
download | perl-c352ee5f96ca31651e1bac4e2f72702d961e700c.tar.gz |
s///: return boolean in not-in-place branch
A while back, s/// (and other ops) were optimised to return
PL_sv_yes/PL_sv_zero rather than an iteration count in boolean context.
This optimisation was missed in one place in pp_subst(): the 'can modify
in place' branch was done, but the other branch was missed.
This commit fixes that.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -4470,7 +4470,10 @@ PP(pp_subst) SvPV_set(dstr, NULL); SPAGAIN; - mPUSHi(iters); + if (PL_op->op_private & OPpTRUEBOOL) + PUSHs(iters ? &PL_sv_yes : &PL_sv_zero); + else + mPUSHi(iters); } } |