Don't rely on inferior_ptid in record_full_wait
[deliverable/binutils-gdb.git] / opcodes / ns32k-dis.c
index 5e6f0964b7aa626796f64dab47cfbdc2483ce48d..51b39260c4f68cb5efb854ce07fe950de521fbc0 100644 (file)
@@ -1,5 +1,5 @@
 /* Print National Semiconductor 32000 instructions.
-   Copyright (C) 1986-2019 Free Software Foundation, Inc.
+   Copyright (C) 1986-2020 Free Software Foundation, Inc.
 
    This file is part of the GNU opcodes library.
 
@@ -327,8 +327,8 @@ bit_copy (bfd_byte *buffer, int offset, int count, char *to)
 static int
 sign_extend (unsigned int value, unsigned int bits)
 {
-  unsigned int sign = 1u << bits;
-  return ((value & (sign - 1)) ^ sign) - sign;
+  unsigned int sign = 1u << (bits - 1);
+  return ((value & (sign + sign - 1)) ^ sign) - sign;
 }
 
 static void
This page took 0.02494 seconds and 4 git commands to generate.