summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorchromatic <chromatic@wgz.org>2009-09-22 08:33:33 -0700
committerJesse Vincent <jesse@bestpractical.com>2009-09-23 06:24:05 +0900
commit9cdcb38b4c31a45dcd09aebdede952de356c30f0 (patch)
tree121e0f18f5115fdd3558312a5946a8e1e6e3fa7c /pp.c
parent9d169eb4da35d0142fb35b8fb32a7564b799bb6a (diff)
downloadperl-9cdcb38b4c31a45dcd09aebdede952de356c30f0.tar.gz
push in Void Context
The attached patch avoids pushing an IV onto the stack for a push op in void context. The "Is there attached magic" branch in the op checks for void context as does the non-magical branch in the unshift op. -- c [Edited version of patch after review by Yitzchak Scott-Thoennes]
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index e3b7798065..fae2d6db9b 100644
--- a/pp.c
+++ b/pp.c
@@ -4738,7 +4738,9 @@ PP(pp_push)
PL_delaymagic = 0;
SP = ORIGMARK;
- PUSHi( AvFILLp(ary) + 1 );
+ if (OP_GIMME(PL_op, 0) != G_VOID) {
+ PUSHi( AvFILL(ary) + 1 );
+ }
}
RETURN;
}