From 1d19cae752a7b032b8253feb4fa3b9f1dc162823 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Tue, 15 Dec 2015 14:09:14 +0100 Subject: 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. --- sim/msp430/ChangeLog | 4 ++++ sim/msp430/msp430-sim.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'sim/msp430') 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 + + * msp430-sim.c (get_op, put_op): Fix left shift of negative value. + 2015-12-07 Nick Clifton * 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; -- cgit v1.1