summaryrefslogtreecommitdiff
path: root/opcodes/arm-dis.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-10-26 19:39:12 +1030
committerAlan Modra <amodra@gmail.com>2021-10-28 07:40:49 +1030
commit459cde81fb571252cad74dd7333d5dc9694cf077 (patch)
treef9eb85c492c40f67cc93eb75bdb26459e10796e2 /opcodes/arm-dis.c
parent296d3d2e156c8fe96c0250d5b59a008e7054946e (diff)
downloadbinutils-gdb-459cde81fb571252cad74dd7333d5dc9694cf077.tar.gz
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/arm-dis.c')
-rw-r--r--opcodes/arm-dis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 78efb815147..5252d36b1be 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)
{