From 93ba6aa9f29189917c248c3d8986492f4218db71 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sun, 7 May 2017 03:51:26 +0100 Subject: [PATCH] PPCAnalyst: Function calls without link added --- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 6b8b23d4ec..1d39d308c3 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -163,9 +163,10 @@ bool AnalyzeFunction(u32 startAddr, Symbol& func, int max_size) if (target == INVALID_BRANCH_TARGET) continue; - if (instr.LK) + const bool is_external = target < startAddr || (max_size && target >= startAddr + max_size); + if (instr.LK || is_external) { - // Found a branch-n-link + // Found a function call func.calls.emplace_back(target, addr); func.flags &= ~FFLAG_LEAF; }