public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] opcodes: SH fix bank register disassemble.
@ 2022-09-22 11:41 Nick Clifton
  0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2022-09-22 11:41 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3b8e069a3691adc1a93ca7f4bcb5e8e687317108

commit 3b8e069a3691adc1a93ca7f4bcb5e8e687317108
Author: Yoshinori Sato <ysato@users.sourceforge.jp>
Date:   Thu Sep 22 12:40:43 2022 +0100

    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.

Diff:
---
 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  <ysato@users.sourceforge.jp>
+
+	* 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  <bergner@linux.ibm.com>
 
 	* 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:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-22 11:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 11:41 [binutils-gdb] opcodes: SH fix bank register disassemble Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).