diff --git a/FEXCore/Source/Interface/Core/Frontend.cpp b/FEXCore/Source/Interface/Core/Frontend.cpp index 780b79d62f..c782ee8f14 100644 --- a/FEXCore/Source/Interface/Core/Frontend.cpp +++ b/FEXCore/Source/Interface/Core/Frontend.cpp @@ -1104,6 +1104,12 @@ void Decoder::DecodeInstructionsAtEntry(const uint8_t* _InstStream, uint64_t PC, auto OpMinPage = OpMinAddress & FEXCore::Utils::FEX_PAGE_MASK; auto OpMaxPage = OpMaxAddress & FEXCore::Utils::FEX_PAGE_MASK; + if (!EntryBlock && OpMinPage == OpMaxPage && PeekByte(0) == 0 && PeekByte(1) == 0) [[unlikely]] { + // End the multiblock early if we hit 2 consecutive null bytes (add [rax], al) in the same page with the + // assumption we are most likely trying to explore garbage code. + break; + } + if (OpMinPage != CurrentCodePage) { CurrentCodePage = OpMinPage; CodePages.insert(CurrentCodePage);