Update README.vos and release vos build macros
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index 59adddf..85a0680 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1,6 +1,6 @@
 /*    scope.c
  *
- *    Copyright (c) 1991-2001, Larry Wall
+ *    Copyright (c) 1991-2002, 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.
@@ -673,7 +673,11 @@ Perl_leave_scope(pTHX_ I32 base)
            str = (char*)SSPOPPTR;
            ptr = SSPOPPTR;
            if (*(char**)ptr != str) {
+#ifdef NETWARE
+               PerlMem_free(*(char**)ptr);
+#else
                PerlMemShared_free(*(char**)ptr);
+#endif
                *(char**)ptr = str;
            }
            break;
@@ -693,7 +697,9 @@ Perl_leave_scope(pTHX_ I32 base)
            DEBUG_S(PerlIO_printf(Perl_debug_log,
                                  "restore svref: %p %p:%s -> %p:%s\n",
                                  ptr, sv, SvPEEK(sv), value, SvPEEK(value)));
-           if (SvTYPE(sv) == SVt_PVMG && SvMAGIC(sv)) {
+           if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
+               SvTYPE(sv) != SVt_PVGV)
+           {
                (void)SvUPGRADE(value, SvTYPE(sv));
                SvMAGIC(value) = SvMAGIC(sv);
                SvFLAGS(value) |= SvMAGICAL(sv);
@@ -705,7 +711,9 @@ Perl_leave_scope(pTHX_ I32 base)
             * croaking that might ensue when the SvSETMAGIC() below is
             * called, or to avoid two different SVs pointing at the same
             * SvMAGIC()).  This needs a total rethink.  --GSAR */
-           else if (SvTYPE(value) == SVt_PVMG && SvMAGIC(value)) {
+           else if (SvTYPE(value) >= SVt_PVMG && SvMAGIC(value) &&
+                    SvTYPE(value) != SVt_PVGV)
+           {
                SvFLAGS(value) |= (SvFLAGS(value) &
                                  (SVp_NOK|SVp_POK)) >> PRIVSHIFT;
                SvMAGICAL_off(value);
@@ -951,6 +959,10 @@ Perl_leave_scope(pTHX_ I32 base)
            PL_op = (OP*)SSPOPPTR;
            break;
        case SAVEt_HINTS:
+           if ((PL_hints & HINT_LOCALIZE_HH) && GvHV(PL_hintgv)) {
+               SvREFCNT_dec((SV*)GvHV(PL_hintgv));
+               GvHV(PL_hintgv) = NULL;
+           }
            *(I32*)&PL_hints = (I32)SSPOPINT;
            break;
        case SAVEt_COMPPAD: