Skip to content
Permalink
Browse files

HLE: Fix patching functions with the same name

  • Loading branch information...
sepalani committed Sep 28, 2019
1 parent 82fd7f5 commit d8a3218726bd447dfeb407c5212f9f07d4e9574c
Showing with 7 additions and 5 deletions.
  1. +7 −5 Source/Core/Core/HLE/HLE.cpp
@@ -192,11 +192,13 @@ u32 GetFunctionIndex(u32 address)

u32 GetFirstFunctionIndex(u32 address)
{
u32 index = GetFunctionIndex(address);
auto first = std::find_if(
s_original_instructions.begin(), s_original_instructions.end(),
[=](const auto& entry) { return entry.second == index && entry.first < address; });
return first == std::end(s_original_instructions) ? index : 0;
const u32 index = GetFunctionIndex(address);
// Fixed hooks use a fixed address and don't patch the whole function
if (index == 0 || OSPatches[index].flags == HookFlag::Fixed)
return index;

const auto symbol = g_symbolDB.GetSymbolFromAddr(address);
return (symbol && symbol->address == address) ? index : 0;
}

HookType GetFunctionTypeByIndex(u32 index)

0 comments on commit d8a3218

Please sign in to comment.
You can’t perform that action at this time.