This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
remove taint hack now that local $tainted no longer copies taint magic
authorDave Mitchell <davem@fdisolutions.com>
Wed, 22 Jun 2005 23:08:55 +0000 (23:08 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Wed, 22 Jun 2005 23:08:55 +0000 (23:08 +0000)
p4raw-id: //depot/perl@24943

mg.c
sv.c

diff --git a/mg.c b/mg.c
index 3669619..96644fb 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1919,8 +1919,7 @@ Perl_magic_setsubstr(pTHX_ SV *sv, MAGIC *mg)
 int
 Perl_magic_gettaint(pTHX_ SV *sv, MAGIC *mg)
 {
-    TAINT_IF((mg->mg_len & 1) ||
-            ((mg->mg_len & 2) && mg->mg_obj == sv));   /* kludge */
+    TAINT_IF(mg->mg_len & 1);
     return 0;
 }
 
@@ -1928,13 +1927,7 @@ int
 Perl_magic_settaint(pTHX_ SV *sv, MAGIC *mg)
 {
     (void)sv;
-    if (PL_localizing) {
-       if (PL_localizing == 1)
-           mg->mg_len <<= 1;
-       else
-           mg->mg_len >>= 1;
-    }
-    else if (PL_tainted)
+    if (PL_tainted)
        mg->mg_len |= 1;
     else
        mg->mg_len &= ~1;
diff --git a/sv.c b/sv.c
index 4cdfacc..3888ce0 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -8472,7 +8472,7 @@ Perl_sv_tainted(pTHX_ SV *sv)
 {
     if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)) {
        MAGIC * const mg = mg_find(sv, PERL_MAGIC_taint);
-       if (mg && ((mg->mg_len & 1) || ((mg->mg_len & 2) && mg->mg_obj == sv)))
+       if (mg && (mg->mg_len & 1) )
            return TRUE;
     }
     return FALSE;