fix(codegen): decode int imm8 instruction length correctly

This commit is contained in:
boykopovar
2026-09-26 15:42:55 +03:00
parent fa10c6d7eb
commit 2cc34985c0
2 changed files with 3 additions and 1 deletions
@@ -5,6 +5,8 @@
namespace Codegen::X64OpcodeConstants {
inline constexpr std::uint8_t OneByteIntImm8 = 0xCD;
inline constexpr std::uint8_t PrefixLock = 0xF0;
inline constexpr std::uint8_t PrefixRepne = 0xF2;
inline constexpr std::uint8_t PrefixRep = 0xF3;
@@ -200,7 +200,7 @@ std::size_t X64InstructionDecoder::Decode(const std::uint8_t* data, std::size_t
immediateSize = ImmSize32;
}
if (opcode == OneByteJmpRel8 || opcode == OneByteJrcxz ||
if (opcode == OneByteJmpRel8 || opcode == OneByteJrcxz || opcode == OneByteIntImm8 ||
(opcode >= OneByteLoop && opcode <= OneByteLoopMax) ||
(opcode >= OneByteInOutImm8Min && opcode <= OneByteInOutImm8Max)) {
immediateSize = ImmSize8;