With PERL_DONT_CREATE_GVSV, don't need to create a new GvSV in
Nicholas Clark [Fri, 24 Feb 2006 23:30:50 +0000 (23:30 +0000)]
Perl_save_scalar.

p4raw-id: //depot/perl@27322

scope.c

diff --git a/scope.c b/scope.c
index 827abe6..ad7f14d 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -181,7 +181,7 @@ SV *
 Perl_save_scalar(pTHX_ GV *gv)
 {
     dVAR;
-    SV ** const sptr = &GvSV(gv);
+    SV ** const sptr = &GvSVn(gv);
     PL_localizing = 1;
     SvGETMAGIC(*sptr);
     PL_localizing = 0;
@@ -264,7 +264,9 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
            IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
        }
        GvGP(gv) = gp_ref(gp);
+#ifndef PERL_DONT_CREATE_GVSV
        GvSV(gv) = newSV(0);
+#endif
        GvLINE(gv) = CopLINE(PL_curcop);
        /* XXX Ideally this cast would be replaced with a change to const char*
           in the struct.  */