mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-06-23 16:05:30 +00:00
Only chase after continious branches
This commit is contained in:
parent
cbfcdc3ebc
commit
05b23d2ad8
@ -124,9 +124,8 @@ Function Function::Analyze(const void* code, size_t size, size_t base)
|
|||||||
{
|
{
|
||||||
blockStack.pop_back();
|
blockStack.pop_back();
|
||||||
|
|
||||||
// single block with a branch means it'd be a tail call
|
// Keep analyzing if we have continuity
|
||||||
// we don't have to analyze the target in that case
|
if (op == PPC_OP_B)
|
||||||
if (op == PPC_OP_B && blocks.size() != 1)
|
|
||||||
{
|
{
|
||||||
const auto branchBase = insn.operands[0] - base;
|
const auto branchBase = insn.operands[0] - base;
|
||||||
const auto branchBlock = fn.SearchBlock(insn.operands[0]);
|
const auto branchBlock = fn.SearchBlock(insn.operands[0]);
|
||||||
@ -138,7 +137,6 @@ Function Function::Analyze(const void* code, size_t size, size_t base)
|
|||||||
if (isContinious && curBlock.projectedSize != -1)
|
if (isContinious && curBlock.projectedSize != -1)
|
||||||
{
|
{
|
||||||
sizeProjection = curBlock.projectedSize - curBlock.size;
|
sizeProjection = curBlock.projectedSize - curBlock.size;
|
||||||
}
|
|
||||||
|
|
||||||
if (branchBlock == -1)
|
if (branchBlock == -1)
|
||||||
{
|
{
|
||||||
@ -146,6 +144,7 @@ Function Function::Analyze(const void* code, size_t size, size_t base)
|
|||||||
blockStack.emplace_back(blocks.size() - 1);
|
blockStack.emplace_back(blocks.size() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!blockStack.empty())
|
if (!blockStack.empty())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user