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,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++;
}
}
}
}