Fix invalid left shift of negative value
[deliverable/binutils-gdb.git] / sim / msp430 / msp430-sim.c
index 3a20f6c0cb0eb86563a4c310c091b1fa069590c5..67118589653434bd82c7a7e0096f6362142af615 100644 (file)
@@ -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;
 
This page took 0.023704 seconds and 4 git commands to generate.