Re: [perl #59280] perlbug AutoReply: PUSH on tied array gives incorrect context to...
Luke Ross [Tue, 30 Sep 2008 22:41:50 +0000 (23:41 +0100)]
From: "Luke Ross" <lukeross@gmail.com>
Message-ID: <970a62710809301441v1d8d1877tfc30d7b91cd4dc1a@mail.gmail.com>

p4raw-id: //depot/perl@34908

pp.c

diff --git a/pp.c b/pp.c
index 166c315..0fbc6e4 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -4523,7 +4523,9 @@ PP(pp_push)
        LEAVE;
        SPAGAIN;
        SP = ORIGMARK;
-       PUSHi( AvFILL(ary) + 1 );
+       if (GIMME_V != G_VOID) {
+           PUSHi( AvFILL(ary) + 1 );
+       }
     }
     else {
        PL_delaymagic = DM_DELAY;
@@ -4581,7 +4583,9 @@ PP(pp_unshift)
        }
     }
     SP = ORIGMARK;
-    PUSHi( AvFILL(ary) + 1 );
+    if (GIMME_V != G_VOID) {
+       PUSHi( AvFILL(ary) + 1 );
+    }
     RETURN;
 }