From: Alan Modra Date: Thu, 2 Jan 2020 20:37:17 +0000 (+1030) Subject: ubsan: crx: left shift cannot be represented in type 'int' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c5c119630be063c97872428084fff51a858dfd3;p=binutils-gdb.git ubsan: crx: left shift cannot be represented in type 'int' * crx-dis.c (match_opcode): Avoid shift left of signed value. --- diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 52ebe868cc9..514466ed635 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2020-01-04 Alan Modra + + * crx-dis.c (match_opcode): Avoid shift left of signed value. + 2020-01-04 Alan Modra * d30v-dis.c (print_insn): Avoid signed overflow in left shift. diff --git a/opcodes/crx-dis.c b/opcodes/crx-dis.c index 18b6c6d9e67..011cd682fc2 100644 --- a/opcodes/crx-dis.c +++ b/opcodes/crx-dis.c @@ -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];