Silence a warning under clang/asan
authorYves Orton <demerphq@gmail.com>
Sat, 15 Dec 2012 20:55:47 +0000 (21:55 +0100)
committerYves Orton <demerphq@gmail.com>
Sat, 15 Dec 2012 21:13:19 +0000 (22:13 +0100)
This should silence the following warning:

dump.c:459:57: warning: comparison of constant 85 with expression of
   type 'svtype' is always false [-Wtautological-constant-out-of-range-compare]

The warning is a false positive, this code is /meant/ to detect
conditions that should not happen.

dump.c

diff --git a/dump.c b/dump.c
index c802732..fcc63fc 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -456,7 +456,8 @@ Perl_sv_peek(pTHX_ SV *sv)
        sv_catpv(t, "VOID");
        goto finish;
     }
-    else if (sv == (const SV *)0x55555555 || SvTYPE(sv) == 'U') {
+    else if (sv == (const SV *)0x55555555 || ((char)SvTYPE(sv)) == 'U') {
+        /* detect data corruption under memory poisoning */
        sv_catpv(t, "WILD");
        goto finish;
     }