* ubsan: bfin-dis.c:160 shift exponent 32 is too large
@ 2020-09-02 8:42 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-09-02 8:42 UTC (permalink / raw)
To: binutils
* bfin-dis.c (MASKBITS): Use SIGNBIT.
diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c
index 4f66f12e3c..3eb6087a3c 100644
--- a/opcodes/bfin-dis.c
+++ b/opcodes/bfin-dis.c
@@ -34,7 +34,7 @@
typedef long TIword;
#define SIGNBIT(bits) (1ul << ((bits) - 1))
-#define MASKBITS(val, bits) ((val) & ((1ul << (bits)) - 1))
+#define MASKBITS(val, bits) ((val) & ((SIGNBIT (bits) << 1) - 1))
#define SIGNEXTEND(v, n) ((MASKBITS (v, n) ^ SIGNBIT (n)) - SIGNBIT (n))
#include "disassemble.h"
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-02 8:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 8:42 ubsan: bfin-dis.c:160 shift exponent 32 is too large Alan Modra
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).