Merge pull request #371 from quarnster/patch-1
PPCAnalyst now detects internal branches better
This commit is contained in:
commit
db08f7bf4a
|
@ -172,12 +172,23 @@ bool AnalyzeFunction(u32 startAddr, Symbol &func, int max_size)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
u32 target = EvaluateBranchTarget(instr, addr);
|
u32 target = EvaluateBranchTarget(instr, addr);
|
||||||
if (target != INVALID_TARGET && instr.LK)
|
if (target != INVALID_TARGET)
|
||||||
|
{
|
||||||
|
if (instr.LK)
|
||||||
{
|
{
|
||||||
//we found a branch-n-link!
|
//we found a branch-n-link!
|
||||||
func.calls.push_back(SCall(target,addr));
|
func.calls.push_back(SCall(target, addr));
|
||||||
func.flags &= ~FFLAG_LEAF;
|
func.flags &= ~FFLAG_LEAF;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (target > farthestInternalBranchTarget)
|
||||||
|
{
|
||||||
|
farthestInternalBranchTarget = target;
|
||||||
|
}
|
||||||
|
numInternalBranches++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue