Fixed operand-action for EVEX/MVEX instructions with write-mask

This commit is contained in:
flobernd 2017-06-25 23:49:19 +02:00
parent 3b45ae2f1d
commit 652b5afadb
1 changed files with 11 additions and 3 deletions

View File

@ -1932,9 +1932,17 @@ FinalizeOperand:
(info->operands[1].reg >= ZYDIS_REGISTER_K1) &&
(info->operands[1].reg <= ZYDIS_REGISTER_K7))
{
ZYDIS_ASSERT(info->operands[0].action == ZYDIS_OPERAND_ACTION_WRITE ||
info->operands[0].action == ZYDIS_OPERAND_ACTION_READWRITE);
info->operands[0].action = ZYDIS_OPERAND_ACTION_READ_CONDWRITE;
switch (info->operands[0].action)
{
case ZYDIS_OPERAND_ACTION_WRITE:
info->operands[0].action = ZYDIS_OPERAND_ACTION_CONDWRITE;
break;
case ZYDIS_OPERAND_ACTION_READWRITE:
info->operands[0].action = ZYDIS_OPERAND_ACTION_READ_CONDWRITE;
break;
default:
ZYDIS_UNREACHABLE;
}
}
return ZYDIS_STATUS_SUCCESS;