diff options
author | Vincent Pit <perl@profvince.com> | 2009-10-04 15:02:56 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2009-10-04 15:02:56 +0200 |
commit | 6eeabd23f5b07b262222f010c01eab5c2175cf54 (patch) | |
tree | aac40e9c6fe792924a4a4394cdf5a1638feda6d6 /pp.c | |
parent | b9fb583619490a0ded37e01402169cea64f6c91e (diff) | |
download | perl-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.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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; |