projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
296d3d2
)
ubsan: arm: undefined shift
author
Alan Modra
<amodra@gmail.com>
Tue, 26 Oct 2021 09:09:12 +0000
(19:39 +1030)
committer
Alan Modra
<amodra@gmail.com>
Wed, 27 Oct 2021 21:10:49 +0000
(07:40 +1030)
left shift of 2 by 31 places cannot be represented in type 'int'
* arm-dis.c (print_insn_thumb16): Avoid undefined behaviour.
opcodes/arm-dis.c
patch
|
blob
|
history
diff --git
a/opcodes/arm-dis.c
b/opcodes/arm-dis.c
index 78efb815147df2c5dc30077ec9b89681e0d34a21..5252d36b1beb55d26e6299aa544868a01df9577a 100644
(file)
--- 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)
{