Omitting an operand by using formatter hooks will now correctly omit the semicolon as well

This commit is contained in:
flobernd 2018-02-05 23:34:54 +01:00
parent 74ef4ac22e
commit ca9898fa42
No known key found for this signature in database
GPG Key ID: 9C3AE0ED4A969F10
1 changed files with 2 additions and 1 deletions

View File

@ -71,6 +71,7 @@ static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisS
ZYDIS_CHECK(formatter->funcPrintPrefixes(formatter, string, instruction, userData));
ZYDIS_CHECK(formatter->funcPrintMnemonic(formatter, string, instruction, userData));
const ZydisUSize strLenMnemonic = string->length;
for (ZydisU8 i = 0; i < instruction->operandCount; ++i)
{
if (instruction->operands[i].visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN)
@ -79,7 +80,7 @@ static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisS
}
const ZydisUSize strLenRestore = string->length;
if (i == 0)
if (string->length == strLenMnemonic)
{
ZYDIS_CHECK(ZydisStringAppendC(string, " "));
} else