Detect if setSymbolProperties has been previously applied

This commit is contained in:
caheckman 2020-01-21 17:05:40 -05:00
parent 885402bbc3
commit a3988a7db2
3 changed files with 13 additions and 8 deletions

View file

@ -1128,7 +1128,7 @@ bool Funcdata::attemptDynamicMapping(SymbolEntry *entry,DynamicHash &dhash)
}
}
else if (entry->getSize() == vn->getSize()) {
vn->setSymbolProperties(entry);
if (vn->setSymbolProperties(entry))
return true;
}
return false;

View file

@ -363,16 +363,21 @@ void Varnode::setDef(PcodeOp *op)
/// 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.
/// \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 (mapentry != entry) {
mapentry = entry;
if (high != (HighVariable *)0)
high->setSymbol(this);
res = true;
}
}
setFlags(entry->getAllFlags() & ~Varnode::typelock);
return res;
}
/// A reference to the given Symbol is set on \b this Varnode.

View file

@ -154,7 +154,7 @@ private:
// These functions should be only private things used by VarnodeBank
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 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 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