From 21cfaa7f607ffa3689c57d126f556d15d08c5331 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 28 Sep 2011 00:44:57 +0000 Subject: [PATCH] Slightly improved decoding of instructions --- src/arch/sparc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/arch/sparc.h b/src/arch/sparc.h index ed3131b..3752418 100644 --- a/src/arch/sparc.h +++ b/src/arch/sparc.h @@ -36,6 +36,7 @@ static int _sparc_decode(ArchPlugin * plugin, ArchInstructionCall * call) uint32_t u32; uint32_t opcode; ArchInstruction * ai; + size_t i; if(helper->read(helper->arch, &u32, sizeof(u32)) != sizeof(u32)) return -1; @@ -64,6 +65,8 @@ static int _sparc_decode(ArchPlugin * plugin, ArchInstructionCall * call) call->operands[0].definition = ai->op1; call->operands[1].definition = ai->op2; call->operands[2].definition = ai->op3; + for(i = 0; i < 3 && call->operands[i].definition != AOT_NONE; i++); + call->operands_cnt = i; return 0; }