This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate perlio:
[perl5.git] / scope.c
diff --git a/scope.c b/scope.c
index da5fa6b..e976f3c 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -673,9 +673,7 @@ 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) &&
-               SvTYPE(sv) != SVt_PVGV)
-           {
+           if (SvTYPE(sv) == SVt_PVMG && SvMAGIC(sv)) {
                (void)SvUPGRADE(value, SvTYPE(sv));
                SvMAGIC(value) = SvMAGIC(sv);
                SvFLAGS(value) |= SvMAGICAL(sv);
@@ -687,9 +685,7 @@ 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) &&
-                    SvTYPE(value) != SVt_PVGV)
-           {
+           else if (SvTYPE(value) == SVt_PVMG && SvMAGIC(value)) {
                SvFLAGS(value) |= (SvFLAGS(value) &
                                  (SVp_NOK|SVp_POK)) >> PRIVSHIFT;
                SvMAGICAL_off(value);
@@ -827,9 +823,8 @@ Perl_leave_scope(pTHX_ I32 base)
                 * if a my variable that was made readonly is going out of
                 * scope, we want to remove the readonlyness so that it can
                 * go out of scope quietly
-                * Disabled as I don't see need yet NI-S 2001/12/18
                 */
-               if (0 && SvPADMY(sv) && ! SvFAKE(sv))
+               if (SvPADMY(sv) && !SvFAKE(sv))
                    SvREADONLY_off(sv);
 
                if (SvTHINKFIRST(sv))