tweaks to overloaded constants (change#1259)
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index 5b0cd78..985c650 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -222,6 +222,9 @@ save_gp(GV *gv, I32 empty)
 
     if (empty) {
        register GP *gp;
+
+       if (GvCVu(gv))
+           sub_generation++;   /* taking a method out of circulation */
        Newz(602, gp, 1, GP);
        GvGP(gv) = gp_ref(gp);
        GvSV(gv) = NEWSV(72,0);
@@ -678,6 +681,8 @@ leave_scope(I32 base)
             SvLEN(gv) = (STRLEN)SSPOPIV;
             gp_free(gv);
             GvGP(gv) = (GP*)ptr;
+           if (GvCVu(gv))
+               sub_generation++;  /* putting a method back into circulation */
            SvREFCNT_dec(gv);
             break;
        case SAVEt_FREESV:
@@ -801,17 +806,23 @@ leave_scope(I32 base)
        case SAVEt_OP:
            op = (OP*)SSPOPPTR;
            break;
+       case SAVEt_HINTS:
+           if (GvHV(hintgv)) {
+               SvREFCNT_dec((SV*)GvHV(hintgv));
+               GvHV(hintgv) = NULL;
+           }
+           *(I32*)&hints = (I32)SSPOPINT;
+           break;
        default:
            croak("panic: leave_scope inconsistency");
        }
     }
 }
 
-#ifdef DEBUGGING
-
 void
 cx_dump(PERL_CONTEXT *cx)
 {
+#ifdef DEBUGGING
     dTHR;
     PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), block_type[cx->cx_type]);
     if (cx->cx_type != CXt_SUBST) {
@@ -900,5 +911,5 @@ cx_dump(PERL_CONTEXT *cx)
                (long)cx->sb_rxres);
        break;
     }
+#endif /* DEBUGGING */
 }
-#endif