Skip to content
Permalink
Browse files

x86: fix issue #756

  • Loading branch information...
aquynh committed Aug 27, 2016
1 parent e147e3a commit d7459a0ed760b62c08d2110292c20491cad8928f
Showing with 4 additions and 2 deletions.
  1. +4 −2 arch/X86/X86Mapping.c
@@ -2941,9 +2941,9 @@ x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access)
unsigned int mid = ARR_SIZE(insn_regs_intel) / 2;

if (!intel_regs_sorted) {
memcpy (insn_regs_intel_sorted, insn_regs_intel,
memcpy(insn_regs_intel_sorted, insn_regs_intel,
sizeof(insn_regs_intel_sorted));
qsort (insn_regs_intel_sorted,
qsort(insn_regs_intel_sorted,
ARR_SIZE(insn_regs_intel_sorted),
sizeof(struct insn_reg), regs_cmp);
intel_regs_sorted = true;
@@ -2958,6 +2958,8 @@ x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access)
}
return insn_regs_intel_sorted[mid].reg;
} else {
if (mid == 0)
break;
last = mid - 1;
}
mid = (first + last) / 2;

0 comments on commit d7459a0

Please sign in to comment.
You can’t perform that action at this time.