diff options
author | Alan Modra <amodra@gmail.com> | 2021-10-26 19:39:12 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-10-28 07:40:49 +1030 |
commit | 459cde81fb571252cad74dd7333d5dc9694cf077 (patch) | |
tree | f9eb85c492c40f67cc93eb75bdb26459e10796e2 /opcodes | |
parent | 296d3d2e156c8fe96c0250d5b59a008e7054946e (diff) | |
download | binutils-459cde81fb571252cad74dd7333d5dc9694cf077.zip binutils-459cde81fb571252cad74dd7333d5dc9694cf077.tar.gz binutils-459cde81fb571252cad74dd7333d5dc9694cf077.tar.bz2 |
ubsan: arm: undefined shift
left shift of 2 by 31 places cannot be represented in type 'int'
* arm-dis.c (print_insn_thumb16): Avoid undefined behaviour.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/arm-dis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 78efb81..5252d36 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -10714,7 +10714,7 @@ print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given) if (!bitend) abort (); reg = given >> bitstart; - reg &= (2 << (bitend - bitstart)) - 1; + reg &= ((bfd_vma) 2 << (bitend - bitstart)) - 1; switch (*c) { |