summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorTassilo von Parseval <tassilo.parseval@post.rwth-aachen.de>2003-09-04 13:13:41 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-08 21:17:45 +0000
commitebf84fa9eceeed5a55ee8ad5eedecbe88cee4866 (patch)
tree8777bb48dbfead81c052167e8709d6087f5ee984 /pp_ctl.c
parent63fd4edf0cafa2ba73b44442589aca27cbd4d767 (diff)
downloadperl-ebf84fa9eceeed5a55ee8ad5eedecbe88cee4866.tar.gz
Integrate:
[ 21062] Subject: [PATCH] honoring void context for map() Message-id: <20030904091341.GA30655@ethan> p4raw-link: @21062 on //depot/perl: 4c90a460cdb7d8d7e800ddcf78d3a123f45708a6 p4raw-id: //depot/maint-5.8/perl@21114 p4raw-integrated: from //depot/perl@21111 'merge in' pp_ctl.c (@20909..)
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 6d76dde802..a0143dd972 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -866,6 +866,7 @@ PP(pp_mapstart)
PP(pp_mapwhile)
{
dSP;
+ I32 gimme = GIMME_V;
I32 items = (SP - PL_stack_base) - *PL_markstack_ptr; /* how many new items */
I32 count;
I32 shift;
@@ -876,7 +877,7 @@ PP(pp_mapwhile)
++PL_markstack_ptr[-1];
/* if there are new items, push them into the destination list */
- if (items) {
+ if (items && gimme != G_VOID) {
/* might need to make room back there first */
if (items > PL_markstack_ptr[-1] - PL_markstack_ptr[-2]) {
/* XXX this implementation is very pessimal because the stack
@@ -920,7 +921,6 @@ PP(pp_mapwhile)
/* All done yet? */
if (PL_markstack_ptr[-1] > *PL_markstack_ptr) {
- I32 gimme = GIMME_V;
(void)POPMARK; /* pop top */
LEAVE; /* exit outer scope */