Add /nologo to nmake in CPANPLUS::Dist::Build too
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index 9bb2b57..4b68f1b 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1,7 +1,7 @@
 /*    scope.c
  *
  *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- *    2000, 2001, 2002, 2003, 2004, 2005, 2006, by Larry Wall and others
+ *    2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -165,12 +165,6 @@ S_save_scalar_at(pTHX_ SV **sptr)
     SV * const osv = *sptr;
     register SV * const sv = *sptr = newSV(0);
 
-#ifdef PERL_MAD
-    /* FIXME for MAD - this is causing ext/Safe/t/safeops.t to abort.  */
-    if (PL_formfeed && sv == PL_formfeed)
-       abort();
-#endif
-
     if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv) && SvTYPE(osv) != SVt_PVGV) {
        if (SvGMAGICAL(osv)) {
            const bool oldtainted = PL_tainted;
@@ -188,10 +182,6 @@ Perl_save_scalar(pTHX_ GV *gv)
 {
     dVAR;
     SV ** const sptr = &GvSVn(gv);
-#ifdef PERL_MAD
-    if (PL_formfeed && *sptr == PL_formfeed)
-       abort();
-#endif
     PL_localizing = 1;
     SvGETMAGIC(*sptr);
     PL_localizing = 0;
@@ -208,10 +198,6 @@ void
 Perl_save_generic_svref(pTHX_ SV **sptr)
 {
     dVAR;
-#ifdef PERL_MAD
-    if (PL_formfeed && *sptr == PL_formfeed)
-       abort();
-#endif
     SSCHECK(3);
     SSPUSHPTR(sptr);
     SSPUSHPTR(SvREFCNT_inc(*sptr));
@@ -270,7 +256,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
        GP *gp = Perl_newGP(aTHX_ gv);
 
        if (GvCVu(gv))
-           PL_sub_generation++;        /* taking a method out of circulation */
+            mro_method_changed_in(GvSTASH(gv)); /* taking a method out of circulation ("local")*/
        if (GvIOp(gv) && (IoFLAGS(GvIOp(gv)) & IOf_ARGV)) {
            gp->gp_io = newIO();
            IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
@@ -328,11 +314,6 @@ Perl_save_item(pTHX_ register SV *item)
     dVAR;
     register SV * const sv = newSVsv(item);
 
-#ifdef PERL_MAD
-    if (PL_formfeed && item == PL_formfeed)
-       abort();
-#endif
-
     SSCHECK(3);
     SSPUSHPTR(item);           /* remember the pointer */
     SSPUSHPTR(sv);             /* remember the value */
@@ -360,6 +341,26 @@ Perl_save_bool(pTHX_ bool *boolp)
 }
 
 void
+Perl_save_I8(pTHX_ I8 *bytep)
+{
+    dVAR;
+    SSCHECK(3);
+    SSPUSHINT(*bytep);
+    SSPUSHPTR(bytep);
+    SSPUSHINT(SAVEt_I8);
+}
+
+void
+Perl_save_I16(pTHX_ I16 *intp)
+{
+    dVAR;
+    SSCHECK(3);
+    SSPUSHINT(*intp);
+    SSPUSHPTR(intp);
+    SSPUSHINT(SAVEt_I16);
+}
+
+void
 Perl_save_I32(pTHX_ I32 *intp)
 {
     dVAR;
@@ -493,6 +494,16 @@ Perl_save_delete(pTHX_ HV *hv, char *key, I32 klen)
 }
 
 void
+Perl_save_destructor(pTHX_ DESTRUCTORFUNC_NOCONTEXT_t f, void* p)
+{
+    dVAR;
+    SSCHECK(3);
+    SSPUSHDPTR(f);
+    SSPUSHPTR(p);
+    SSPUSHINT(SAVEt_DESTRUCTOR);
+}
+
+void
 Perl_save_destructor_x(pTHX_ DESTRUCTORFUNC_t f, void* p)
 {
     dVAR;
@@ -551,10 +562,6 @@ SV*
 Perl_save_svref(pTHX_ SV **sptr)
 {
     dVAR;
-#ifdef PERL_MAD
-    if (PL_formfeed && *sptr == PL_formfeed)
-       abort();
-#endif
     SvGETMAGIC(*sptr);
     SSCHECK(3);
     SSPUSHPTR(sptr);
@@ -622,7 +629,8 @@ Perl_leave_scope(pTHX_ I32 base)
            sv = *(SV**)ptr;
            DEBUG_S(PerlIO_printf(Perl_debug_log,
                                  "restore svref: %p %p:%s -> %p:%s\n",
-                                 ptr, sv, SvPEEK(sv), value, SvPEEK(value)));
+                                 (void*)ptr, (void*)sv, SvPEEK(sv),
+                                 (void*)value, SvPEEK(value)));
            *(SV**)ptr = value;
            SvREFCNT_dec(sv);
            PL_localizing = 2;
@@ -709,7 +717,15 @@ Perl_leave_scope(pTHX_ I32 base)
            break;
        case SAVEt_I32:                         /* I32 reference */
            ptr = SSPOPPTR;
+#ifdef PERL_DEBUG_READONLY_OPS
+           {
+               const I32 val = SSPOPINT;
+               if (*(I32*)ptr != val)
+                   *(I32*)ptr = val;
+           }
+#else
            *(I32*)ptr = (I32)SSPOPINT;
+#endif
            break;
        case SAVEt_SPTR:                        /* SV* reference */
            ptr = SSPOPPTR;
@@ -733,8 +749,9 @@ Perl_leave_scope(pTHX_ I32 base)
            gv = (GV*)SSPOPPTR;
            gp_free(gv);
            GvGP(gv) = (GP*)ptr;
-           if (GvCVu(gv))
-               PL_sub_generation++;  /* putting a method back into circulation */
+            /* putting a method back into circulation ("local")*/
+           if (GvCVu(gv) && (hv=GvSTASH(gv)) && HvNAME_get(hv))
+                mro_method_changed_in(hv);
            SvREFCNT_dec(gv);
            break;
        case SAVEt_FREESV:
@@ -831,6 +848,10 @@ Perl_leave_scope(pTHX_ I32 base)
            i = SSPOPINT;
            PL_stack_sp = PL_stack_base + i;
            break;
+       case SAVEt_STACK_CXPOS:         /* blk_oldsp on context stack */
+           i = SSPOPINT;
+           cxstack[i].blk_oldsp = SSPOPINT;
+           break;
        case SAVEt_AELEM:               /* array element */
            value = (SV*)SSPOPPTR;
            i = SSPOPINT;
@@ -999,6 +1020,10 @@ Perl_leave_scope(pTHX_ I32 base)
                Copy(state, &PL_reg_state, 1, struct re_save_state);
            }
            break;
+       case SAVEt_PARSER:
+           ptr = SSPOPPTR;
+           parser_free((yy_parser *) ptr);
+           break;
        default:
            Perl_croak(aTHX_ "panic: leave_scope inconsistency");
        }
@@ -1033,7 +1058,7 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
        PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%"UVxf"\n",
                PTR2UV(cx->blk_sub.dfoutgv));
        PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
-               (int)CX_SUB_HASARGS_GET(cx));
+               (int)cx->blk_sub.hasargs);
        PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
                PTR2UV(cx->blk_sub.retop));
        break;
@@ -1043,7 +1068,7 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
        PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
                (long)cx->blk_sub.olddepth);
        PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
-               (int)CX_SUB_HASARGS_GET(cx));
+               (int)cx->blk_sub.hasargs);
        PerlIO_printf(Perl_debug_log, "BLK_SUB.LVAL = %d\n",
                (int)cx->blk_sub.lval);
        PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
@@ -1069,12 +1094,10 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
                cx->blk_loop.label);
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
                (long)cx->blk_loop.resetsp);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%"UVxf"\n",
-               PTR2UV(cx->blk_loop.redo_op));
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.MY_OP = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.my_op));
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%"UVxf"\n",
-               PTR2UV(cx->blk_loop.next_op));
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%"UVxf"\n",
-               PTR2UV(cx->blk_loop.last_op));
+               PTR2UV(CX_LOOP_NEXTOP_GET(cx)));
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
                (long)cx->blk_loop.iterix);
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%"UVxf"\n",