This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [ID 20010426.005] Magic not being removed at scope exit [PATCH]
authorJohn Peacock <jpeacock@rowman.com>
Thu, 24 May 2001 22:14:01 +0000 (18:14 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 26 May 2001 13:14:30 +0000 (13:14 +0000)
Message-ID: <3B0DBFE9.A7C49084@rowman.com>

p4raw-id: //depot/perl@10214

mg.c
scope.c
sv.c

diff --git a/mg.c b/mg.c
index 0c865bc..59233f7 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -51,7 +51,7 @@ S_save_magic(pTHX_ I32 mgs_ix, SV *sv)
 
     SvMAGICAL_off(sv);
     SvREADONLY_off(sv);
-    SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
+    SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_NOK|SVp_POK)) >> PRIVSHIFT;
 }
 
 /*
diff --git a/scope.c b/scope.c
index d9e1ecf..a82c0f5 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -203,7 +203,7 @@ S_save_scalar_at(pTHX_ SV **sptr)
                mg->mg_obj = osv;
            }
            SvFLAGS(osv) |= (SvFLAGS(osv) &
-               (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
+               (SVp_NOK|SVp_POK)) >> PRIVSHIFT;
            PL_tainted = oldtainted;
        }
        SvMAGIC(sv) = SvMAGIC(osv);
@@ -699,7 +699,7 @@ Perl_leave_scope(pTHX_ I32 base)
                     SvTYPE(value) != SVt_PVGV)
            {
                SvFLAGS(value) |= (SvFLAGS(value) &
-                                  (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
+                                  (SVp_NOK|SVp_POK)) >> PRIVSHIFT;
                SvMAGICAL_off(value);
                /* XXX this is a leak when we get here because the
                 * mg_get() in save_scalar_at() croaked */
diff --git a/sv.c b/sv.c
index bbb0d7e..d852712 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -4206,7 +4206,7 @@ Perl_sv_unmagic(pTHX_ SV *sv, int type)
     }
     if (!SvMAGIC(sv)) {
        SvMAGICAL_off(sv);
-       SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
+       SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_NOK|SVp_POK)) >> PRIVSHIFT;
     }
 
     return 0;