From 31ec57ab81790b4fd8f7237adc60279535416166 Mon Sep 17 00:00:00 2001 From: Fredrik Ehnbom Date: Thu, 15 May 2014 16:36:44 +0200 Subject: [PATCH] PPCAnalyst now detects internal branches better For example: ``` addr opcode disasm 80026584 48000054 b ->0x800265D8 ``` --- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index edf1425299..286acf5017 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -172,11 +172,22 @@ bool AnalyzeFunction(u32 startAddr, Symbol &func, int max_size) else { u32 target = EvaluateBranchTarget(instr, addr); - if (target != INVALID_TARGET && instr.LK) + if (target != INVALID_TARGET) { - //we found a branch-n-link! - func.calls.push_back(SCall(target,addr)); - func.flags &= ~FFLAG_LEAF; + if (instr.LK) + { + //we found a branch-n-link! + func.calls.push_back(SCall(target, addr)); + func.flags &= ~FFLAG_LEAF; + } + else + { + if (target > farthestInternalBranchTarget) + { + farthestInternalBranchTarget = target; + } + numInternalBranches++; + } } } }