Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8886 from JosJuice/stack-check-instruction
PatchEngine: Attempt to fix crash in IsStackSane
  • Loading branch information
Tilka committed Aug 8, 2020
2 parents 6356cc8 + 364ef76 commit 3101d95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Source/Core/Core/PatchEngine.cpp
Expand Up @@ -231,7 +231,8 @@ static bool IsStackSane()

// Check the link register makes sense (that it points to a valid IBAT address)
const u32 address = PowerPC::HostRead_U32(next_SP + 4);
return PowerPC::HostIsInstructionRAMAddress(address) && 0 != PowerPC::HostRead_U32(address);
return PowerPC::HostIsInstructionRAMAddress(address) &&
0 != PowerPC::HostRead_Instruction(address);
}

bool ApplyFramePatches()
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/Core/PowerPC/MMU.cpp
Expand Up @@ -423,8 +423,7 @@ TryReadInstResult TryReadInstruction(u32 address)

u32 HostRead_Instruction(const u32 address)
{
UGeckoInstruction inst = HostRead_U32(address);
return inst.hex;
return ReadFromHardware<XCheckTLBFlag::OpcodeNoException, u32>(address);
}

static void Memcheck(u32 address, u32 var, bool write, size_t size)
Expand Down

0 comments on commit 3101d95

Please sign in to comment.