mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
Detect if setSymbolProperties has been previously applied
This commit is contained in:
parent
885402bbc3
commit
a3988a7db2
3 changed files with 13 additions and 8 deletions
|
@ -1128,8 +1128,8 @@ bool Funcdata::attemptDynamicMapping(SymbolEntry *entry,DynamicHash &dhash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (entry->getSize() == vn->getSize()) {
|
else if (entry->getSize() == vn->getSize()) {
|
||||||
vn->setSymbolProperties(entry);
|
if (vn->setSymbolProperties(entry))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -363,16 +363,21 @@ void Varnode::setDef(PcodeOp *op)
|
||||||
/// The given Symbol's data-type and flags are inherited by \b this Varnode.
|
/// The given Symbol's data-type and flags are inherited by \b this Varnode.
|
||||||
/// If the Symbol is \e type-locked, a reference to the Symbol is set on \b this Varnode.
|
/// If the Symbol is \e type-locked, a reference to the Symbol is set on \b this Varnode.
|
||||||
/// \param entry is a mapping to the given Symbol
|
/// \param entry is a mapping to the given Symbol
|
||||||
void Varnode::setSymbolProperties(SymbolEntry *entry)
|
/// \return \b true if any properties have changed
|
||||||
|
bool Varnode::setSymbolProperties(SymbolEntry *entry)
|
||||||
|
|
||||||
{
|
{
|
||||||
entry->updateType(this);
|
bool res = entry->updateType(this);
|
||||||
if (entry->getSymbol()->isTypeLocked()) {
|
if (entry->getSymbol()->isTypeLocked()) {
|
||||||
mapentry = entry;
|
if (mapentry != entry) {
|
||||||
if (high != (HighVariable *)0)
|
mapentry = entry;
|
||||||
high->setSymbol(this);
|
if (high != (HighVariable *)0)
|
||||||
|
high->setSymbol(this);
|
||||||
|
res = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setFlags(entry->getAllFlags() & ~Varnode::typelock);
|
setFlags(entry->getAllFlags() & ~Varnode::typelock);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A reference to the given Symbol is set on \b this Varnode.
|
/// A reference to the given Symbol is set on \b this Varnode.
|
||||||
|
|
|
@ -154,7 +154,7 @@ private:
|
||||||
// These functions should be only private things used by VarnodeBank
|
// These functions should be only private things used by VarnodeBank
|
||||||
void setInput(void) { setFlags(Varnode::input|Varnode::coverdirty); } ///< Mark Varnode as \e input
|
void setInput(void) { setFlags(Varnode::input|Varnode::coverdirty); } ///< Mark Varnode as \e input
|
||||||
void setDef(PcodeOp *op); ///< Set the defining PcodeOp of this Varnode
|
void setDef(PcodeOp *op); ///< Set the defining PcodeOp of this Varnode
|
||||||
void setSymbolProperties(SymbolEntry *entry); ///< Set properties from the given Symbol to \b this Varnode
|
bool setSymbolProperties(SymbolEntry *entry); ///< Set properties from the given Symbol to \b this Varnode
|
||||||
void setSymbolEntry(SymbolEntry *entry); ///< Attach a Symbol to \b this Varnode
|
void setSymbolEntry(SymbolEntry *entry); ///< Attach a Symbol to \b this Varnode
|
||||||
void setSymbolReference(SymbolEntry *entry,int4 off); ///< Attach a Symbol reference to \b this
|
void setSymbolReference(SymbolEntry *entry,int4 off); ///< Attach a Symbol reference to \b this
|
||||||
void addDescend(PcodeOp *op); ///< Add a descendant (reading) PcodeOp to this Varnode's list
|
void addDescend(PcodeOp *op); ///< Add a descendant (reading) PcodeOp to this Varnode's list
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue