summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-04 12:46:20 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:21 +0100
commita5bf735cf20c7f70ccb9686bb726d979d5043c77 (patch)
tree019d8d9a6da8a61fb453c45366ff609ea3556ba7 /pp.c
parent725c44f93c35f696d7175c36a6d2ec5987b5a4d1 (diff)
downloadperl-a5bf735cf20c7f70ccb9686bb726d979d5043c77.tar.gz
S_check_for_bool_cxt(): special-case OP_AND
Re-instate the special-casing, which was removed by v5.25.8-172-gb243b19, of OP_AND in boolean-context determination. This is because the special-case allowed things to be more efficient sometimes, but required returning a false value as sv_2mortal(newSViv(0))) rather than &PL_sv_no. Now that PL_sv_zero has been added we can use that instead, cheaply. This commit adds an extra arg to S_check_for_bool_cxt() to indicate whether the op supports the special-casing of OP_AND.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index efe629a0a1..d76d0b877f 100644
--- a/pp.c
+++ b/pp.c
@@ -150,7 +150,7 @@ PP(pp_padhv)
&& block_gimme() == G_VOID ))
&& (!SvRMAGICAL(TARG) || !mg_find(TARG, PERL_MAGIC_tied))
)
- SETs(HvUSEDKEYS(TARG) ? &PL_sv_yes : &PL_sv_no);
+ SETs(HvUSEDKEYS(TARG) ? &PL_sv_yes : &PL_sv_zero);
else if (gimme == G_SCALAR) {
SV* const sv = Perl_hv_scalar(aTHX_ MUTABLE_HV(TARG));
SETs(sv);