From 2bddb71a7421213dd9d8b8f2db133b43f5e1357e Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 20 Jan 2020 12:31:58 +1030 Subject: [PATCH] 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. * arm-dis.c (print_insn_arm): Wrap 'T' value. --- opcodes/ChangeLog | 4 ++++ opcodes/arm-dis.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 1f717519270..04eaa863e7c 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2020-01-20 Alan Modra + + * arm-dis.c (print_insn_arm): Wrap 'T' value. + 2020-01-18 Nick Clifton * configure: Regenerate. diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index c986b5897ed..be2a93253bb 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') { -- 2.30.2