This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ubsan: vax: left shift cannot be represented in type 'int'
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 11 Dec 2019 11:31:51 +1030
- Subject: ubsan: vax: left shift cannot be represented in type 'int'
* vax-dis.c (NEXTLONG): Avoid signed overflow.
diff --git a/opcodes/vax-dis.c b/opcodes/vax-dis.c
index 2c02c29d72..3bdfa15192 100644
--- a/opcodes/vax-dis.c
+++ b/opcodes/vax-dis.c
@@ -64,7 +64,7 @@ static char *entry_mask_bit[] =
#define COERCE32(x) ((int) (((x) ^ 0x80000000) - 0x80000000))
#define NEXTLONG(p) \
(p += 4, FETCH_DATA (info, p), \
- (COERCE32 ((((((p[-1] << 8) + p[-2]) << 8) + p[-3]) << 8) + p[-4])))
+ (COERCE32 (((((((unsigned) p[-1] << 8) + p[-2]) << 8) + p[-3]) << 8) + p[-4])))
/* Maximum length of an instruction. */
#define MAXLEN 25
--
Alan Modra
Australia Development Lab, IBM