aboutsummaryrefslogtreecommitdiff
path: root/opcodes/cr16-dis.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-01-03 08:12:00 +1030
committerAlan Modra <amodra@gmail.com>2020-01-04 19:20:33 +1030
commit5f57d4ecf51c2f420dae56dfb9fc525d1979ec7c (patch)
tree97bdde3887f9cfe408b2a7765c8adb370699f4ee /opcodes/cr16-dis.c
parent2c5c119630be063c97872428084fff51a858dfd3 (diff)
downloadfsf-binutils-gdb-5f57d4ecf51c2f420dae56dfb9fc525d1979ec7c.zip
fsf-binutils-gdb-5f57d4ecf51c2f420dae56dfb9fc525d1979ec7c.tar.gz
fsf-binutils-gdb-5f57d4ecf51c2f420dae56dfb9fc525d1979ec7c.tar.bz2
ubsan: cr16: left shift cannot be represented in type 'int'
* cr16-dis.c (cr16_match_opcode): Avoid shift left of signed value.
Diffstat (limited to 'opcodes/cr16-dis.c')
-rw-r--r--opcodes/cr16-dis.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/opcodes/cr16-dis.c b/opcodes/cr16-dis.c
index c40a07e..1be67b2 100644
--- a/opcodes/cr16-dis.c
+++ b/opcodes/cr16-dis.c
@@ -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];