mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Fix combinatorial explosion in ancestorOpUse
This commit is contained in:
parent
e7b63fdab5
commit
e8b7a61197
1 changed files with 11 additions and 4 deletions
|
@ -1584,13 +1584,20 @@ bool Funcdata::ancestorOpUse(int4 maxlevel,const Varnode *invn,
|
||||||
// as an "only use"
|
// as an "only use"
|
||||||
if (def->isIndirectCreation())
|
if (def->isIndirectCreation())
|
||||||
return false;
|
return false;
|
||||||
// fallthru
|
return ancestorOpUse(maxlevel-1,def->getIn(0),op,trial);
|
||||||
case CPUI_MULTIEQUAL:
|
case CPUI_MULTIEQUAL:
|
||||||
// Check if there is any ancestor whose only
|
// Check if there is any ancestor whose only
|
||||||
// use is in this op
|
// use is in this op
|
||||||
for(i=0;i<def->numInput();++i)
|
if (def->isMark()) return false; // Trim the loop
|
||||||
if (ancestorOpUse(maxlevel-1,def->getIn(i),op,trial)) return true;
|
def->setMark(); // Mark that this MULTIEQUAL is on the path
|
||||||
|
// Note: onlyOpUse is using Varnode::setMark
|
||||||
|
for(i=0;i<def->numInput();++i) {
|
||||||
|
if (ancestorOpUse(maxlevel-1,def->getIn(i),op,trial)) {
|
||||||
|
def->clearMark();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
def->clearMark();
|
||||||
return false;
|
return false;
|
||||||
case CPUI_COPY:
|
case CPUI_COPY:
|
||||||
if ((invn->getSpace()->getType()==IPTR_INTERNAL)||def->isIncidentalCopy()||def->getIn(0)->isIncidentalCopy()) {
|
if ((invn->getSpace()->getType()==IPTR_INTERNAL)||def->isIncidentalCopy()||def->getIn(0)->isIncidentalCopy()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue