ubsan: crx: left shift cannot be represented in type 'int'
authorAlan Modra <amodra@gmail.com>
Thu, 2 Jan 2020 20:37:17 +0000 (07:07 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 4 Jan 2020 08:50:33 +0000 (19:20 +1030)
* crx-dis.c (match_opcode): Avoid shift left of signed value.

opcodes/ChangeLog
opcodes/crx-dis.c

index 52ebe868cc9b277089ec88bbee3642bf7f05a88e..514466ed635e7b620bc5992ce44a8ff3717b1141 100644 (file)
@@ -1,3 +1,7 @@
+2020-01-04  Alan Modra  <amodra@gmail.com>
+
+       * crx-dis.c (match_opcode): Avoid shift left of signed value.
+
 2020-01-04  Alan Modra  <amodra@gmail.com>
 
        * d30v-dis.c (print_insn): Avoid signed overflow in left shift.
index 18b6c6d9e670714330649c1172fa0e12ab17f952..011cd682fc262782a0cdddef3804dff9331fab34 100644 (file)
@@ -337,7 +337,7 @@ match_opcode (void)
   unsigned int mask;
 
   /* The instruction 'constant' opcode doewsn't exceed 32 bits.  */
-  unsigned int doubleWord = (words[1] + (words[0] << 16)) & 0xffffffff;
+  unsigned int doubleWord = words[1] + ((unsigned) words[0] << 16);
 
   /* Start searching from end of instruction table.  */
   instruction = &crx_instruction[NUMOPCODES - 2];
This page took 0.02482 seconds and 4 git commands to generate.