mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
hidden extensions with multiple descendants
This commit is contained in:
parent
8860979785
commit
7870b20f96
1 changed files with 11 additions and 7 deletions
|
@ -1289,14 +1289,15 @@ bool PrintC::isExtensionCastImplied(const PcodeOp *op) const
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PcodeOp *expOp = outVn->loneDescend();
|
type_metatype metatype = outVn->getHigh()->getType()->getMetatype();
|
||||||
if (expOp != (PcodeOp *)0) {
|
list<PcodeOp *>::const_iterator iter;
|
||||||
type_metatype metatype = outVn->getHigh()->getType()->getMetatype();
|
for(iter=outVn->beginDescend();iter!=outVn->endDescend();++iter) {
|
||||||
|
PcodeOp *expOp = *iter;
|
||||||
Varnode *otherVn;
|
Varnode *otherVn;
|
||||||
int4 slot;
|
int4 slot;
|
||||||
switch(expOp->code()) {
|
switch(expOp->code()) {
|
||||||
case CPUI_PTRADD:
|
case CPUI_PTRADD:
|
||||||
return true;
|
break;
|
||||||
case CPUI_INT_ADD:
|
case CPUI_INT_ADD:
|
||||||
case CPUI_INT_SUB:
|
case CPUI_INT_SUB:
|
||||||
case CPUI_INT_MULT:
|
case CPUI_INT_MULT:
|
||||||
|
@ -1311,13 +1312,16 @@ bool PrintC::isExtensionCastImplied(const PcodeOp *op) const
|
||||||
slot = expOp->getSlot(outVn);
|
slot = expOp->getSlot(outVn);
|
||||||
otherVn = expOp->getIn(1-slot);
|
otherVn = expOp->getIn(1-slot);
|
||||||
// Check if the expression involves an explicit variable of the right integer type
|
// Check if the expression involves an explicit variable of the right integer type
|
||||||
if (otherVn->isExplicit() && otherVn->getHigh()->getType()->getMetatype() == metatype)
|
if (!otherVn->isExplicit())
|
||||||
return true;
|
return false;
|
||||||
|
if (otherVn->getHigh()->getType()->getMetatype() != metatype)
|
||||||
|
return false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true; // Everything is integer promotion
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue