Nit to change 30762 by Gisle.
Rafael Garcia-Suarez [Mon, 26 Mar 2007 14:36:17 +0000 (14:36 +0000)]
Avoids storing the chars removed by 4-arg substr() in void context.

p4raw-id: //depot/perl@30763

pp.c

diff --git a/pp.c b/pp.c
index 34ae75f..b5c696c 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3115,7 +3115,7 @@ PP(pp_substr)
            }
        }
 
-       if (! lvalue)
+       if (GIMME_V != G_VOID && !lvalue)
            sv_setpvn(TARG, tmps, rem);
 #ifdef USE_LOCALE_COLLATE
        sv_unmagic(TARG, PERL_MAGIC_collxfrm);