This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] opcodes: blackfin: catch invalid loopsetup insns


The LoopSetup insn is only valid when the reg field is 0-7, so
don't go decoding it incorrectly when reg is 8-15.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2011-02-05  Mike Frysinger  <vapier@gentoo.org>

	* bfin-dis.c (decode_LoopSetup_0): Return when reg is greater
	than 7.
---
 opcodes/bfin-dis.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c
index c7dd5b8..bd536eb 100644
--- a/opcodes/bfin-dis.c
+++ b/opcodes/bfin-dis.c
@@ -2620,6 +2620,9 @@ decode_LoopSetup_0 (TIword iw0, TIword iw1, bfd_vma pc, disassemble_info *outf)
   if (priv->parallel)
     return 0;
 
+  if (reg > 7)
+    return 0;
+
   if (rop == 0)
     {
       OUTS (outf, "LSETUP");
-- 
1.7.4.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]