mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-2286 Formal boolean Varnodes
This commit is contained in:
parent
a438a1e1ea
commit
d8835b0ecb
9 changed files with 74 additions and 48 deletions
|
@ -819,6 +819,24 @@ Datatype *Varnode::getLocalType(bool &blockup) const
|
|||
return ct;
|
||||
}
|
||||
|
||||
/// If \b this varnode is produced by an operation with a boolean output, or if it is
|
||||
/// formally marked with a boolean data-type, return \b true. The parameter \b trustAnnotation
|
||||
/// toggles whether or not the formal data-type is trusted.
|
||||
/// \return \b true if \b this is a formal boolean, \b false otherwise
|
||||
bool Varnode::isBooleanValue(bool useAnnotation) const
|
||||
|
||||
{
|
||||
if (isWritten()) return def->isCalculatedBool();
|
||||
if (!useAnnotation)
|
||||
return false;
|
||||
if ((flags & (input | typelock)) == (input | typelock)) {
|
||||
if (size == 1 && type->getMetatype() == TYPE_BOOL)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// Make a local determination if \b this and \b op2 hold the same value. We check if
|
||||
/// there is a common ancester for which both \b this and \b op2 are created from a direct
|
||||
/// sequence of COPY operations. NOTE: This is a transitive relationship
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue