]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: adjust type checking constructs
authorJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2022 09:07:44 +0000 (10:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2022 09:07:44 +0000 (10:07 +0100)
As Alan points out, ASAN takes issue with these constructs, for
current_templates being NULL. Wrap them in sizeof(), so the expressions
aren't actually evaluated.

gas/config/tc-i386.c

index ffe97d9d10e5e72de43634737cc7d18eb7e51935..990f4b9fec22826f857dcf78268ba0a6aa380fe4 100644 (file)
@@ -2985,8 +2985,8 @@ md_begin (void)
 
     /* Type checks to compensate for the conversion through void * which
        occurs during hash table insertion / lookup.  */
-    (void)(sets == &current_templates->start);
-    (void)(end == &current_templates->end);
+    (void) sizeof (sets == &current_templates->start);
+    (void) sizeof (end == &current_templates->end);
     for (; sets < end; ++sets)
       if (str_hash_insert (op_hash, (*sets)->name, sets, 0))
        as_fatal (_("duplicate %s"), (*sets)->name);