x86: adjust type checking constructs

Message ID af826d86-8600-6a8b-f696-0b26c7774d45@suse.com
State Unresolved
Headers
Series x86: adjust type checking constructs |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Jan Beulich Dec. 14, 2022, 9:07 a.m. UTC
  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.
  

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -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);