From 3b8e069a3691adc1a93ca7f4bcb5e8e687317108 Mon Sep 17 00:00:00 2001 From: Yoshinori Sato Date: Thu, 22 Sep 2022 12:40:43 +0100 Subject: [PATCH] opcodes: SH fix bank register disassemble. * sh-dis.c (print_insn_sh): Enforce bit7 of LDC Rm,Rn_BANK and STC Rm_BANK,Rn is always 1. --- opcodes/ChangeLog | 5 +++++ opcodes/sh-dis.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 1a23be86d70..bbd3544b83d 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2022-09-22 Yoshinori Sato + + * sh-dis.c (print_insn_sh): Enforce bit7 of LDC Rm,Rn_BANK and STC + Rm_BANK,Rn is always 1. + 2022-07-21 Peter Bergner * ppc-opc.c (XACC_MASK, XX3ACC_MASK): New defines. diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c index 0e46cb6f4d9..49dbc23d920 100644 --- a/opcodes/sh-dis.c +++ b/opcodes/sh-dis.c @@ -645,6 +645,8 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info) rm = (nibs[n] & 0x3); break; case REG_B: + if (!(nibs[n] & 0x08)) /* Must always be 1. */ + goto fail; rb = nibs[n] & 0x07; break; case SDT_REG_N: -- 2.30.2