1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2025-01-08 22:30:55 +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. Instrux->EncMode = ND_ENCM_LEGACY; // Assume legacy encoding by default.
// Fetch the instruction bytes. // Fetch the instruction bytes.
for (opIndex = 0; if (Size < ND_MAX_INSTRUCTION_LENGTH)
opIndex < ((Size < ND_MAX_INSTRUCTION_LENGTH) ? Size : ND_MAX_INSTRUCTION_LENGTH);
opIndex++)
{ {
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) if (gPrefixesMap[Instrux->InstructionBytes[0]] != ND_PREF_CODE_NONE)