mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
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.
This commit is contained in:
committed by
Andreas Arnez
parent
08832196ac
commit
1d19cae752
@@ -3317,7 +3317,7 @@ v850_bins (SIM_DESC sd, unsigned int source, unsigned int lsb, unsigned int msb,
|
||||
pos = lsb;
|
||||
width = (msb - lsb) + 1;
|
||||
|
||||
mask = ~ (-1 << width);
|
||||
mask = ~ (-(1 << width));
|
||||
source &= mask;
|
||||
mask <<= pos;
|
||||
result = (* dest) & ~ mask;
|
||||
|
||||
Reference in New Issue
Block a user