1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2024-12-22 22:18:09 +00:00

Move condition away from loop header

This commit is contained in:
Turo Lamminen 2024-08-31 21:24:45 +03:00
parent c877b5007f
commit 21da6eddaf

View File

@ -4427,11 +4427,19 @@ NdDecodeWithContext(
Instrux->EncMode = ND_ENCM_LEGACY; // Assume legacy encoding by default.
// Fetch the instruction bytes.
for (opIndex = 0;
opIndex < ((Size < ND_MAX_INSTRUCTION_LENGTH) ? Size : ND_MAX_INSTRUCTION_LENGTH);
opIndex++)
if (Size < ND_MAX_INSTRUCTION_LENGTH)
{
Instrux->InstructionBytes[opIndex] = Code[opIndex];
for (opIndex = 0; opIndex < Size; opIndex++)
{
Instrux->InstructionBytes[opIndex] = Code[opIndex];
}
}
else
{
for (opIndex = 0; opIndex < ND_MAX_INSTRUCTION_LENGTH; opIndex++)
{
Instrux->InstructionBytes[opIndex] = Code[opIndex];
}
}
if (gPrefixesMap[Instrux->InstructionBytes[0]] != ND_PREF_CODE_NONE)