Merge remote-tracking branch 'origin/GP-1405_ThisPointerPrep'

This commit is contained in:
Ryan Kurtz 2022-07-07 00:58:42 -04:00
commit 7e4df39fe5
7 changed files with 64 additions and 1 deletions

View file

@ -302,7 +302,7 @@ void ScopeLocal::collectNameRecs(void)
// If the "this" pointer points to a class, try to preserve the data-type
// even though the symbol is not preserved.
SymbolEntry *entry = sym->getFirstWholeMap();
typeRecommend.push_back(TypeRecommend(entry->getAddr(),dt));
addTypeRecommendation(entry->getAddr(), dt);
}
}
}
@ -1385,6 +1385,16 @@ void ScopeLocal::applyTypeRecommendations(void)
}
}
/// Associate a data-type with a particular storage address. If we see an input Varnode at this address,
/// if no other info is available, the given data-type is applied.
/// \param addr is the storage address
/// \param dt is the given data-type
void ScopeLocal::addTypeRecommendation(const Address &addr,Datatype *dt)
{
typeRecommend.push_back(TypeRecommend(addr,dt));
}
/// The symbol is stored as a name recommendation and then removed from the scope.
/// Name recommendations are associated either with a storage address and usepoint, or a dynamic hash.
/// The name may be reattached to a Symbol after decompilation.