aboutsummaryrefslogtreecommitdiff
path: root/opcodes/bfin-dis.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-09-02 10:33:07 +0930
committerAlan Modra <amodra@gmail.com>2020-09-02 16:30:44 +0930
commit427202d96790f1b659e0fa9485b8128c95dc48db (patch)
treeac6688064391049efec6828d2f52d5764337351b /opcodes/bfin-dis.c
parentc77a6ef6109c10e999b33e8f762809701084109c (diff)
downloadbinutils-427202d96790f1b659e0fa9485b8128c95dc48db.zip
binutils-427202d96790f1b659e0fa9485b8128c95dc48db.tar.gz
binutils-427202d96790f1b659e0fa9485b8128c95dc48db.tar.bz2
ubsan: bfin-dis.c:160 shift exponent 32 is too large
* bfin-dis.c (MASKBITS): Use SIGNBIT.
Diffstat (limited to 'opcodes/bfin-dis.c')
-rw-r--r--opcodes/bfin-dis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c
index 4f66f12..3eb6087 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"