Describe __PACKAGE__ in perldelta
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index 2fdea90..f7835b7 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1,6 +1,6 @@
 /*    scope.c
  *
- *    Copyright (c) 1991-1994, Larry Wall
+ *    Copyright (c) 1991-1997, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -173,14 +173,13 @@ I32 empty;
     if (empty) {
        register GP *gp;
        Newz(602, gp, 1, GP);
-       GvGP(gv) = gp;
-       GvREFCNT(gv) = 1;
+       GvGP(gv) = gp_ref(gp);
        GvSV(gv) = NEWSV(72,0);
        GvLINE(gv) = curcop->cop_line;
        GvEGV(gv) = gv;
     }
     else {
-       GvGP(gv)->gp_refcnt++;
+       gp_ref(GvGP(gv));
        GvINTRO_on(gv);
     }
 }
@@ -526,7 +525,8 @@ I32 base;
            break;
        case SAVEt_FREEOP:
            ptr = SSPOPPTR;
-           curpad = AvARRAY(comppad);
+           if (comppad)
+               curpad = AvARRAY(comppad);
            op_free((OP*)ptr);
            break;
        case SAVEt_FREEPV:
@@ -556,13 +556,15 @@ I32 base;
                    hv_clear((HV*)sv);
                    break;
                case SVt_PVCV:
-                   sub_generation++;
-                   cv_undef((CV*)sv);
+                   croak("panic: leave_scope pad code");
+               case SVt_RV:
+               case SVt_IV:
+               case SVt_NV:
+                   (void)SvOK_off(sv);
                    break;
                default:
-                   if (SvPOK(sv) && SvLEN(sv))
-                       (void)SvOOK_off(sv);
                    (void)SvOK_off(sv);
+                   (void)SvOOK_off(sv);
                    break;
                }
            }