Merge pull request #4256 from lioncash/anyof
PPCAnalyst: Compress loop into std::any_of
This commit is contained in:
commit
a714460ee3
|
@ -191,16 +191,10 @@ static void AnalyzeFunction2(Symbol* func)
|
||||||
{
|
{
|
||||||
u32 flags = func->flags;
|
u32 flags = func->flags;
|
||||||
|
|
||||||
bool nonleafcall = false;
|
bool nonleafcall = std::any_of(func->calls.begin(), func->calls.end(), [](const auto& call) {
|
||||||
for (const SCall& c : func->calls)
|
const Symbol* called_func = g_symbolDB.GetSymbolFromAddr(call.function);
|
||||||
{
|
return called_func && (called_func->flags & FFLAG_LEAF) == 0;
|
||||||
Symbol* called_func = g_symbolDB.GetSymbolFromAddr(c.function);
|
});
|
||||||
if (called_func && (called_func->flags & FFLAG_LEAF) == 0)
|
|
||||||
{
|
|
||||||
nonleafcall = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nonleafcall && !(flags & FFLAG_EVIL) && !(flags & FFLAG_RFI))
|
if (nonleafcall && !(flags & FFLAG_EVIL) && !(flags & FFLAG_RFI))
|
||||||
flags |= FFLAG_ONLYCALLSNICELEAFS;
|
flags |= FFLAG_ONLYCALLSNICELEAFS;
|
||||||
|
|
Loading…
Reference in New Issue