aboutsummaryrefslogtreecommitdiff
path: root/sim/msp430
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2015-12-15 14:09:14 +0100
committerAndreas Arnez <arnez@linux.vnet.ibm.com>2015-12-15 14:09:14 +0100
commit1d19cae752a7b032b8253feb4fa3b9f1dc162823 (patch)
treefcd5b5f015c8f9dc4e541049369e89e52ab6c8ba /sim/msp430
parent08832196accd270fa053e8125c21e7a54ab19fe0 (diff)
downloadgdb-1d19cae752a7b032b8253feb4fa3b9f1dc162823.zip
gdb-1d19cae752a7b032b8253feb4fa3b9f1dc162823.tar.gz
gdb-1d19cae752a7b032b8253feb4fa3b9f1dc162823.tar.bz2
Fix invalid left shift of negative value
Fix occurrences of left-shifting negative constants in C code. sim/arm/ChangeLog: * thumbemu.c (handle_T2_insn): Fix left shift of negative value. * armemu.c (handle_v6_insn): Likewise. sim/avr/ChangeLog: * interp.c (sign_ext): Fix left shift of negative value. sim/mips/ChangeLog: * micromips.igen (process_isa_mode): Fix left shift of negative value. sim/msp430/ChangeLog: * msp430-sim.c (get_op, put_op): Fix left shift of negative value. sim/v850/ChangeLog: * simops.c (v850_bins): Fix left shift of negative value.
Diffstat (limited to 'sim/msp430')
-rw-r--r--sim/msp430/ChangeLog4
-rw-r--r--sim/msp430/msp430-sim.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sim/msp430/ChangeLog b/sim/msp430/ChangeLog
index 21f5329..53fece0 100644
--- a/sim/msp430/ChangeLog
+++ b/sim/msp430/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-15 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * msp430-sim.c (get_op, put_op): Fix left shift of negative value.
+
2015-12-07 Nick Clifton <nickc@redhat.com>
* msp430-sim.c (sim_open): Check for needed memory at address
diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c
index 3a20f6c..6711858 100644
--- a/sim/msp430/msp430-sim.c
+++ b/sim/msp430/msp430-sim.c
@@ -364,7 +364,7 @@ get_op (SIM_DESC sd, MSP430_Opcode_Decoded *opc, int n)
/* Index values are signed. */
if (addr & (1 << (sign - 1)))
- addr |= -1 << sign;
+ addr |= -(1 << sign);
addr += reg;
@@ -565,7 +565,7 @@ put_op (SIM_DESC sd, MSP430_Opcode_Decoded *opc, int n, int val)
/* Index values are signed. */
if (addr & (1 << (sign - 1)))
- addr |= -1 << sign;
+ addr |= -(1 << sign);
addr += reg;