x86: adjust type checking constructs

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.
This commit is contained in:
Jan Beulich
2022-12-14 10:07:44 +01:00
parent 8ad93045ed
commit eb99386180

View File

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