Changed default element-count from 0 to 1

This commit is contained in:
flobernd 2017-06-23 04:26:21 +02:00
parent c8c3d29ba4
commit cd3bf5586b
1 changed files with 4 additions and 2 deletions

View File

@ -989,7 +989,6 @@ static void ZydisSetOperandSizeAndElementInfo(ZydisDecoderContext* context,
ZYDIS_ASSERT(definition->size[context->eoszIndex] == 0);
operand->size = info->addressWidth;
operand->elementType = ZYDIS_ELEMENT_TYPE_INT;
operand->elementCount = 1;
} else
{
ZYDIS_ASSERT(definition->size[context->eoszIndex]);
@ -1145,7 +1144,7 @@ static void ZydisSetOperandSizeAndElementInfo(ZydisDecoderContext* context,
ZYDIS_UNREACHABLE;
}
// Element info
// Element-type and -size
if (definition->elementType && (definition->elementType != ZYDIS_IELEMENT_TYPE_VARIABLE))
{
ZydisGetElementInfo(definition->elementType, &operand->elementType, &operand->elementSize);
@ -1156,6 +1155,9 @@ static void ZydisSetOperandSizeAndElementInfo(ZydisDecoderContext* context,
operand->elementSize = operand->size;
}
}
// Element count
operand->elementCount = 1;
if (operand->elementSize && operand->size)
{
operand->elementCount = operand->size / operand->elementSize;