summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2009-10-04 15:02:56 +0200
committerVincent Pit <perl@profvince.com>2009-10-04 15:02:56 +0200
commit6eeabd23f5b07b262222f010c01eab5c2175cf54 (patch)
treeaac40e9c6fe792924a4a4394cdf5a1638feda6d6 /pp.c
parentb9fb583619490a0ded37e01402169cea64f6c91e (diff)
downloadperl-6eeabd23f5b07b262222f010c01eab5c2175cf54.tar.gz
Apply the same policy for the value returned by push() and unshift()
That is, only push the len when the static context is not void, and honour len magic.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/pp.c b/pp.c
index fae2d6db9b..ef7d7ab303 100644
--- a/pp.c
+++ b/pp.c
@@ -4720,10 +4720,6 @@ PP(pp_push)
call_method("PUSH",G_SCALAR|G_DISCARD);
LEAVE;
SPAGAIN;
- SP = ORIGMARK;
- if (GIMME_V != G_VOID) {
- PUSHi( AvFILL(ary) + 1 );
- }
}
else {
PL_delaymagic = DM_DELAY;
@@ -4737,10 +4733,10 @@ PP(pp_push)
mg_set(MUTABLE_SV(ary));
PL_delaymagic = 0;
- SP = ORIGMARK;
- if (OP_GIMME(PL_op, 0) != G_VOID) {
- PUSHi( AvFILL(ary) + 1 );
- }
+ }
+ SP = ORIGMARK;
+ if (OP_GIMME(PL_op, 0) != G_VOID) {
+ PUSHi( AvFILL(ary) + 1 );
}
RETURN;
}
@@ -4783,7 +4779,7 @@ PP(pp_unshift)
}
}
SP = ORIGMARK;
- if (GIMME_V != G_VOID) {
+ if (OP_GIMME(PL_op, 0) != G_VOID) {
PUSHi( AvFILL(ary) + 1 );
}
RETURN;