This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Assert that IVs and NVs can never be tainted.
authorNicholas Clark <nick@ccl4.org>
Mon, 30 Jan 2006 00:18:52 +0000 (00:18 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 30 Jan 2006 00:18:52 +0000 (00:18 +0000)
p4raw-id: //depot/perl@26997

sv.c

diff --git a/sv.c b/sv.c
index a177947..029de83 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3146,8 +3146,11 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
            SvIV_set(dstr,  SvIVX(sstr));
            if (SvIsUV(sstr))
                SvIsUV_on(dstr);
-           if (SvTAINTED(sstr))
-               SvTAINT(dstr);
+           /* SvTAINTED can only be true if the SV has taint magic, which in
+              turn means that the SV type is PVMG (or greater). This is the
+              case statement for SVt_IV, so this cannot be true (whatever gcov
+              may say).  */
+           assert(!SvTAINTED(sstr));
            return;
        }
        goto undef_sstr;
@@ -3167,8 +3170,11 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
            }
            SvNV_set(dstr, SvNVX(sstr));
            (void)SvNOK_only(dstr);
-           if (SvTAINTED(sstr))
-               SvTAINT(dstr);
+           /* SvTAINTED can only be true if the SV has taint magic, which in
+              turn means that the SV type is PVMG (or greater). This is the
+              case statement for SVt_NV, so this cannot be true (whatever gcov
+              may say).  */
+           assert(!SvTAINTED(sstr));
            return;
        }
        goto undef_sstr;