Merge pull request #371 from quarnster/patch-1

PPCAnalyst now detects internal branches better
This commit is contained in:
Ryan Houdek 2014-06-06 02:45:24 -05:00
commit db08f7bf4a

View file

@ -172,12 +172,23 @@ 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)
{
if (instr.LK)
{
//we found a branch-n-link!
func.calls.push_back(SCall(target,addr));
func.calls.push_back(SCall(target, addr));
func.flags &= ~FFLAG_LEAF;
}
else
{
if (target > farthestInternalBranchTarget)
{
farthestInternalBranchTarget = target;
}
numInternalBranches++;
}
}
}
}
}