From cdcf05a87874a07e3248243eaafa0735e596d130 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 12 Dec 2024 16:23:30 +1000 Subject: [PATCH] CPU/Recompiler: Only truncate block for future writes If we overwrite an instruction that has already executed, it should invalidate the block next time. --- src/core/cpu_recompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/cpu_recompiler.cpp b/src/core/cpu_recompiler.cpp index 0e11dbab3..f8cb96113 100644 --- a/src/core/cpu_recompiler.cpp +++ b/src/core/cpu_recompiler.cpp @@ -1707,7 +1707,7 @@ void CPU::Recompiler::Recompiler::CompileLoadStoreTemplate( { // Get rid of physical aliases. const u32 phys_spec_addr = VirtualAddressToPhysical(spec_addr.value()); - if (phys_spec_addr >= VirtualAddressToPhysical(m_block->pc) && + if (phys_spec_addr >= VirtualAddressToPhysical(m_compiler_pc) && phys_spec_addr < VirtualAddressToPhysical(m_block->pc + (m_block->size * sizeof(Instruction)))) { WARNING_LOG("Instruction {:08X} speculatively writes to {:08X} inside block {:08X}-{:08X}. Truncating block.",