ubsan: crx: left shift cannot be represented in type 'int'

* crx-dis.c (match_opcode): Avoid shift left of signed value.
This commit is contained in:
Alan Modra 2020-01-03 07:07:17 +10:30
parent 2e98c6c5c5
commit 2c5c119630
2 changed files with 5 additions and 1 deletions

View 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.

View 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];