summaryrefslogtreecommitdiff
path: root/tools/arch/x86/lib/insn.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/arch/x86/lib/insn.c')
-rw-r--r--tools/arch/x86/lib/insn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
index be2b057f91d4..cd4dedde3265 100644
--- a/tools/arch/x86/lib/insn.c
+++ b/tools/arch/x86/lib/insn.c
@@ -714,6 +714,13 @@ int insn_get_length(struct insn *insn)
return 0;
}
+/* Ensure this instruction is decoded completely */
+static inline int insn_complete(struct insn *insn)
+{
+ return insn->opcode.got && insn->modrm.got && insn->sib.got &&
+ insn->displacement.got && insn->immediate.got;
+}
+
/**
* insn_decode() - Decode an x86 instruction
* @insn: &struct insn to be initialized