Skip to content

Commit

Permalink
x86: checkPrefix() does not set prefix0 in repne case
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Jun 8, 2019
1 parent 550a598 commit 886c535
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/X86/X86DisassemblerDecoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,20 +794,20 @@ static int readOpcode(struct InternalInstruction* insn)
// mmmmmFromVEX2of3(insn->vectorExtensionPrefix[1]));
return -1;
case VEX_LOB_0F:
insn->twoByteEscape = 0x0f;
//insn->twoByteEscape = 0x0f;
insn->opcodeType = TWOBYTE;
return consumeByte(insn, &insn->opcode);
case VEX_LOB_0F38:
insn->twoByteEscape = 0x0f;
//insn->twoByteEscape = 0x0f;
insn->opcodeType = THREEBYTE_38;
return consumeByte(insn, &insn->opcode);
case VEX_LOB_0F3A:
insn->twoByteEscape = 0x0f;
//insn->twoByteEscape = 0x0f;
insn->opcodeType = THREEBYTE_3A;
return consumeByte(insn, &insn->opcode);
}
} else if (insn->vectorExtensionType == TYPE_VEX_2B) {
insn->twoByteEscape = 0x0f;
//insn->twoByteEscape = 0x0f;
insn->opcodeType = TWOBYTE;
return consumeByte(insn, &insn->opcode);
} else if (insn->vectorExtensionType == TYPE_XOP) {
Expand Down Expand Up @@ -2281,6 +2281,7 @@ static bool checkPrefix(struct InternalInstruction *insn)
}
}

#if 0
// REPNE prefix
if (insn->repeatPrefix) {
// 0xf2 can be a part of instruction encoding, but not really a prefix.
Expand All @@ -2289,6 +2290,7 @@ static bool checkPrefix(struct InternalInstruction *insn)
insn->prefix0 = 0;
}
}
#endif

// no invalid prefixes
return false;
Expand Down

0 comments on commit 886c535

Please sign in to comment.