Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #371 from quarnster/patch-1
PPCAnalyst now detects internal branches better
  • Loading branch information
Sonicadvance1 committed Jun 6, 2014
2 parents 7ffea5d + 31ec57a commit db08f7b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Source/Core/Core/PowerPC/PPCAnalyst.cpp
Expand Up @@ -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++;
}
}
}
}
Expand Down

0 comments on commit db08f7b

Please sign in to comment.