From c39582b9ed7cf6be7c2403076e82322ecd970333 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 17 Oct 2024 18:42:45 +1030 Subject: [PATCH] Core: Make sure CX86RecompilerOps::SPECIAL_AND can not write to R0 --- .../N64System/Recompiler/x86/x86RecompilerOps.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index a67e99a1d..08608eabf 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -5470,6 +5470,10 @@ void CX86RecompilerOps::SPECIAL_SUBU() void CX86RecompilerOps::SPECIAL_AND() { + if (m_Opcode.rd == 0) + { + return; + } if (m_RegWorkingSet.IsKnown(m_Opcode.rt) && m_RegWorkingSet.IsKnown(m_Opcode.rs)) { if (m_RegWorkingSet.IsConst(m_Opcode.rt) && m_RegWorkingSet.IsConst(m_Opcode.rs))