Given that SvPV on a typeglob is now irrelevant, really we only need
Nicholas Clark [Fri, 24 Feb 2006 22:43:14 +0000 (22:43 +0000)]
to store the GvGP.

p4raw-id: //depot/perl@27321

scope.c

diff --git a/scope.c b/scope.c
index 8f7383a..827abe6 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -247,12 +247,7 @@ void
 Perl_save_gp(pTHX_ GV *gv, I32 empty)
 {
     dVAR;
-    SSGROW(6);
-    SSPUSHIV((IV)SvLEN(gv));
-    SvLEN_set(gv, 0); /* forget that anything was allocated here */
-    SSPUSHIV((IV)SvCUR(gv));
-    SSPUSHPTR(SvPVX_const(gv));
-    SvPOK_off(gv);
+    SSGROW(3);
     SSPUSHPTR(SvREFCNT_inc(gv));
     SSPUSHPTR(GvGP(gv));
     SSPUSHINT(SAVEt_GP);
@@ -723,12 +718,6 @@ Perl_leave_scope(pTHX_ I32 base)
        case SAVEt_GP:                          /* scalar reference */
            ptr = SSPOPPTR;
            gv = (GV*)SSPOPPTR;
-           if (SvPVX_const(gv) && SvLEN(gv) > 0) {
-               Safefree(SvPVX_mutable(gv));
-           }
-           SvPV_set(gv, (char *)SSPOPPTR);
-           SvCUR_set(gv, (STRLEN)SSPOPIV);
-           SvLEN_set(gv, (STRLEN)SSPOPIV);
            gp_free(gv);
            GvGP(gv) = (GP*)ptr;
            if (GvCVu(gv))