Skip to content
Snippets Groups Projects
Commit 5f57d4ec authored by Alan Modra's avatar Alan Modra
Browse files

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

	* cr16-dis.c (cr16_match_opcode): Avoid shift left of signed value.
parent 2c5c1196
No related branches found
No related tags found
No related merge requests found
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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment