public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86: adjust type checking constructs
@ 2022-12-14  9:07 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2022-12-14  9:07 UTC (permalink / raw)
  To: Binutils

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.

--- 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-14  9:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14  9:07 [PATCH] x86: adjust type checking constructs Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).