PPCAnalyst now detects internal branches better

For example:

```
addr     opcode    disasm
80026584 48000054  b	->0x800265D8 
```
This commit is contained in:
Fredrik Ehnbom 2014-05-15 16:36:44 +02:00
parent 36720e6822
commit 31ec57ab81
1 changed files with 15 additions and 4 deletions

View File

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