summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-15 22:26:04 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:24 +0100
commite3ad3bbc29184edf8de9c3acf6b85e79e632b069 (patch)
tree0d00681ccdf119e106bd7082ad91dd1b6ebc403e /pp_hot.c
parent3773545d7938a87216a5f326c367a8c445193939 (diff)
downloadperl-e3ad3bbc29184edf8de9c3acf6b85e79e632b069.tar.gz
pp_grepwhile: no need to extend the stack
when returning from grep in scalar context, no need to extend the stack by one when pushing the result count, since the last grep iteration will have pushed its result which we've just popped.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index c580f26021..4c391f7552 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -3579,10 +3579,10 @@ PP(pp_grepwhile)
SP = PL_stack_base + POPMARK; /* pop original mark */
if (gimme == G_SCALAR) {
if (PL_op->op_private & OPpTRUEBOOL)
- XPUSHs(items ? &PL_sv_yes : &PL_sv_zero);
+ PUSHs(items ? &PL_sv_yes : &PL_sv_zero);
else {
dTARGET;
- XPUSHi(items);
+ PUSHi(items);
}
}
else if (gimme == G_ARRAY)