From: Alan Modra Date: Tue, 26 Oct 2021 09:09:12 +0000 (+1030) Subject: ubsan: arm: undefined shift X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=459cde81fb571252cad74dd7333d5dc9694cf077;p=binutils-gdb.git 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. --- 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) {