From 6e01934edcc87c23989eeade22b657ffd2ed8138 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Wed, 5 Feb 2025 00:26:46 +0000 Subject: [PATCH] Frontend: Zero InstructionSize before decoding Required for PeekByte to work correctly before decoding. --- FEXCore/Source/Interface/Core/Frontend.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FEXCore/Source/Interface/Core/Frontend.cpp b/FEXCore/Source/Interface/Core/Frontend.cpp index 0a0008a3f..d8e6681d8 100644 --- a/FEXCore/Source/Interface/Core/Frontend.cpp +++ b/FEXCore/Source/Interface/Core/Frontend.cpp @@ -1174,6 +1174,8 @@ void Decoder::DecodeInstructionsAtEntry(const uint8_t* _InstStream, uint64_t PC, InstStream = AdjustAddrForSpecialRegion(_InstStream, EntryPoint, RIPToDecode); while (1) { + InstructionSize = 0; + // MAX_INST_SIZE assumes worst case auto OpAddress = RIPToDecode + PCOffset; auto OpMaxAddress = OpAddress + MAX_INST_SIZE;