summaryrefslogtreecommitdiff
path: root/opcodes/cgen-dis.c
diff options
context:
space:
mode:
authorMichael McConville <mmcco@mykolab.com>2016-02-01 10:41:32 +0000
committerNick Clifton <nickc@redhat.com>2016-02-01 10:41:32 +0000
commitd8c823c8b62b4f0fc4747eb9e4e29739add34c17 (patch)
treeec85efaa6d68150cac51b7712d4281b5363187ca /opcodes/cgen-dis.c
parentb6471e6e2c88ae473453e3499d9cb6a607a3e068 (diff)
downloadbinutils-gdb-d8c823c8b62b4f0fc4747eb9e4e29739add34c17.tar.gz
Fix undefined compilation behaviour shifting a value into the sign bit of a signed integer.
* cgen-dis.c (count_decodable_bits): Use unsigned value for mask test bit.
Diffstat (limited to 'opcodes/cgen-dis.c')
-rw-r--r--opcodes/cgen-dis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/opcodes/cgen-dis.c b/opcodes/cgen-dis.c
index f9f7fb28675..2d0f701c962 100644
--- a/opcodes/cgen-dis.c
+++ b/opcodes/cgen-dis.c
@@ -40,7 +40,8 @@ count_decodable_bits (const CGEN_INSN *insn)
{
unsigned mask = CGEN_INSN_BASE_MASK (insn);
int bits = 0;
- int m;
+ unsigned m;
+
for (m = 1; m != 0; m <<= 1)
{
if (mask & m)