ubsan: vax: left shift cannot be represented in type 'int'
authorAlan Modra <amodra@gmail.com>
Tue, 10 Dec 2019 22:27:45 +0000 (08:57 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 11 Dec 2019 01:12:09 +0000 (11:42 +1030)
* vax-dis.c (NEXTLONG): Avoid signed overflow.

opcodes/ChangeLog
opcodes/vax-dis.c

index 2ad26cb5d6f05a28f9027677b887299aa8337973..c1fce7f33cc936763e93f3d648200ae305cd86b5 100644 (file)
@@ -1,3 +1,7 @@
+2019-12-11  Alan Modra  <amodra@gmail.com>
+
+       * vax-dis.c (NEXTLONG): Avoid signed overflow.
+
 2019-12-11  Alan Modra  <amodra@gmail.com>
 
        * v850-dis.c (get_operand_value): Use unsigned arithmetic.  Don't
index 2c02c29d72d4d22d202c56d32f09a03cb06991f9..3bdfa151920434131b2dcc0abe241ef943212ee9 100644 (file)
@@ -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
This page took 0.02483 seconds and 4 git commands to generate.