Skip to content

Commit

Permalink
Fix #1869
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Feb 15, 2024
1 parent 8a1c8da commit 24f898f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions qemu/target/i386/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1490,12 +1490,13 @@ static void gen_op(DisasContext *s1, int op, MemOp ot, int d)
TCGContext *tcg_ctx = s1->uc->tcg_ctx;
uc_engine *uc = s1->uc;

/* Invalid lock prefix when destination is not memory or OP_CMPL. */
if ((d != OR_TMP0 || op == OP_CMPL) && s1->prefix & PREFIX_LOCK){
gen_illegal_opcode(s1);
return;
}

if (d != OR_TMP0) {
if (s1->prefix & PREFIX_LOCK) {
/* Lock prefix when destination is not memory. */
gen_illegal_opcode(s1);
return;
}
gen_op_mov_v_reg(s1, ot, s1->T0, d);
} else if (!(s1->prefix & PREFIX_LOCK)) {
gen_op_ld_v(s1, ot, s1->T0, s1->A0);
Expand Down

0 comments on commit 24f898f

Please sign in to comment.