This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ubsan: arm: out of bounds array access
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 20 Jan 2020 20:20:02 +1030
- Subject: ubsan: arm: out of bounds array access
.inst 0x81bdfe9f
disassembles as
0: 81bdfe9f ldaexdhi pc, reg-names-std, [sp]
I'm quite sure "reg-names-std" isn't an ARM register. Yes, I know
wrapping the 'T' value results in something that won't assemble..
* arm-dis.c (print_insn_arm): Wrap 'T' value.
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index c986b5897e..be2a93253b 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -10106,7 +10106,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
case 'T':
/* We want register + 1 when decoding T. */
if (*c == 'T')
- ++value;
+ value = (value + 1) & 0xf;
if (c[1] == 'u')
{
--
Alan Modra
Australia Development Lab, IBM