aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/cr16-dis.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 514466e..d72dcec 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
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.
2020-01-04 Alan Modra <amodra@gmail.com>
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];