From da35abbbe2d09735b26d7d2ea3c0aeba7edaba18 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Wed, 22 Feb 2017 20:12:19 -0800 Subject: [PATCH] PatchEngine: check instruction at link addr is non-zero Regression introduced in #4738. Fixes https://bugs.dolphin-emu.org/issues/10110. --- Source/Core/Core/PatchEngine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PatchEngine.cpp b/Source/Core/Core/PatchEngine.cpp index 58207da6c5..7fea082b63 100644 --- a/Source/Core/Core/PatchEngine.cpp +++ b/Source/Core/Core/PatchEngine.cpp @@ -223,7 +223,8 @@ static bool IsStackSane() return false; // Check the link register makes sense (that it points to a valid IBAT address) - return PowerPC::HostIsInstructionRAMAddress(PowerPC::HostRead_U32(next_SP + 4)); + const u32 address = PowerPC::HostRead_U32(next_SP + 4); + return PowerPC::HostIsInstructionRAMAddress(address) && 0 != PowerPC::HostRead_U32(address); } bool ApplyFramePatches()