mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/GP-2654_ReconcileAdjustments'
This commit is contained in:
commit
43a93554e2
4 changed files with 18 additions and 3 deletions
|
@ -214,7 +214,6 @@ int main(int argc,char **argv)
|
||||||
|
|
||||||
if (initscript != (const char *)0) {
|
if (initscript != (const char *)0) {
|
||||||
try {
|
try {
|
||||||
status->setErrorIsDone(true);
|
|
||||||
status->pushScript(initscript,"init> ");
|
status->pushScript(initscript,"init> ");
|
||||||
} catch(IfaceParseError &err) {
|
} catch(IfaceParseError &err) {
|
||||||
*status->optr << err.explain << endl;
|
*status->optr << err.explain << endl;
|
||||||
|
|
|
@ -4661,6 +4661,8 @@ void ActionInferTypes::propagateRef(Funcdata &data,Varnode *vn,const Address &ad
|
||||||
++iter;
|
++iter;
|
||||||
if (curvn->isAnnotation()) continue;
|
if (curvn->isAnnotation()) continue;
|
||||||
if ((!curvn->isWritten())&&curvn->hasNoDescend()) continue;
|
if ((!curvn->isWritten())&&curvn->hasNoDescend()) continue;
|
||||||
|
if (curvn->isTypeLock()) continue;
|
||||||
|
if (curvn->getSymbolEntry() != (SymbolEntry *)0) continue;
|
||||||
uintb curoff = curvn->getOffset() - off;
|
uintb curoff = curvn->getOffset() - off;
|
||||||
int4 cursize = curvn->getSize();
|
int4 cursize = curvn->getSize();
|
||||||
if (curoff + cursize > ct->getSize()) continue;
|
if (curoff + cursize > ct->getSize()) continue;
|
||||||
|
|
|
@ -162,6 +162,7 @@ void IfaceStatus::pushScript(istream *iptr,const string &newprompt)
|
||||||
if (errorisdone)
|
if (errorisdone)
|
||||||
flags |= 1;
|
flags |= 1;
|
||||||
flagstack.push_back(flags);
|
flagstack.push_back(flags);
|
||||||
|
errorisdone = true; // Abort on first exception in a script
|
||||||
prompt = newprompt;
|
prompt = newprompt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,22 @@ bool RangeHint::reconcile(const RangeHint *b) const
|
||||||
|
|
||||||
if (sub == (Datatype *)0) return false;
|
if (sub == (Datatype *)0) return false;
|
||||||
if (umod != 0) return false;
|
if (umod != 0) return false;
|
||||||
if (sub->getSize() < b->type->getSize()) return false;
|
if (sub->getSize() == b->type->getSize()) return true;
|
||||||
|
if ((b->flags & Varnode::typelock)!=0) return false;
|
||||||
|
// If we reach here, component sizes do not match
|
||||||
|
// Check for data-types we want to protect more
|
||||||
|
type_metatype meta = a->type->getMetatype();
|
||||||
|
if (meta != TYPE_STRUCT && meta != TYPE_UNION) {
|
||||||
|
if (meta != TYPE_ARRAY || ((TypeArray *)(a->type))->getBase()->getMetatype() == TYPE_UNKNOWN)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// For structures, unions, and arrays, test if b looks like a partial data-type
|
||||||
|
meta = b->type->getMetatype();
|
||||||
|
if (meta == TYPE_UNKNOWN || meta == TYPE_INT || meta == TYPE_UINT) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Return \b true if \b this or the given range contains the other.
|
/// \brief Return \b true if \b this or the given range contains the other.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue