Skip to content

Commit

Permalink
x86: loope/loopne read EFLAGS. bug reported by Ruslan Kabatsayev
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Aug 14, 2015
1 parent f0c7da0 commit 60d40cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/X86/X86Mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -47119,6 +47119,13 @@ void X86_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
insn->detail->regs_write_count = 1;
break;
}

// LOOPE & LOOPNE also read EFLAGS
if (insn->id != X86_INS_LOOP) {
insn->detail->regs_read[1] = X86_REG_EFLAGS;
insn->detail->regs_read_count = 2;
}

break;

case X86_INS_LODSB:
Expand Down

0 comments on commit 60d40cf

Please sign in to comment.