mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:54:41 +08:00
ubsan: cr16: left shift cannot be represented in type 'int'
* cr16-dis.c (cr16_match_opcode): Avoid shift left of signed value.
This commit is contained in:
parent
2c5c119630
commit
5f57d4ecf5
@ -1,3 +1,7 @@
|
||||
2020-01-04 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* cr16-dis.c (cr16_match_opcode): Avoid shift left of signed value.
|
||||
|
||||
2020-01-04 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* crx-dis.c (match_opcode): Avoid shift left of signed value.
|
||||
|
@ -319,8 +319,7 @@ cr16_match_opcode (void)
|
||||
{
|
||||
unsigned long mask;
|
||||
/* The instruction 'constant' opcode doesn't exceed 32 bits. */
|
||||
unsigned long doubleWord = (cr16_words[1]
|
||||
+ (cr16_words[0] << 16)) & 0xffffffff;
|
||||
unsigned long doubleWord = cr16_words[1] + ((unsigned) cr16_words[0] << 16);
|
||||
|
||||
/* Start searching from end of instruction table. */
|
||||
instruction = &cr16_instruction[NUMOPCODES - 2];
|
||||
|
Loading…
Reference in New Issue
Block a user