]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/v850/simops.c
Fix invalid left shift of negative value
[thirdparty/binutils-gdb.git] / sim / v850 / simops.c
index b8b3856ec666af2067356263314c231ca2cdae71..40d578e5d0ac87e17c5716c05cae787167668af9 100644 (file)
@@ -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;