mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-3961 Error messages for setFields
This commit is contained in:
parent
bc24351495
commit
a7ad4aef26
4 changed files with 37 additions and 26 deletions
|
@ -2793,8 +2793,11 @@ Datatype *CParse::newStruct(const string &ident,vector<TypeDeclarator *> *declis
|
|||
}
|
||||
|
||||
TypeStruct::assignFieldOffsets(sublist);
|
||||
if (!glb->types->setFields(sublist,res,-1,-1,0)) {
|
||||
setError("Bad structure definition");
|
||||
try {
|
||||
glb->types->setFields(sublist,res,-1,-1,0);
|
||||
}
|
||||
catch (LowlevelError &err) {
|
||||
setError(err.explain);
|
||||
glb->types->destroyType(res);
|
||||
return (Datatype *)0;
|
||||
}
|
||||
|
@ -2826,8 +2829,11 @@ Datatype *CParse::newUnion(const string &ident,vector<TypeDeclarator *> *declist
|
|||
sublist.emplace_back(i,0,decl->getIdentifier(),decl->buildType(glb));
|
||||
}
|
||||
|
||||
if (!glb->types->setFields(sublist,res,-1,-1,0)) {
|
||||
setError("Bad union definition");
|
||||
try {
|
||||
glb->types->setFields(sublist,res,-1,-1,0);
|
||||
}
|
||||
catch (LowlevelError &err) {
|
||||
setError(err.explain);
|
||||
glb->types->destroyType(res);
|
||||
return (Datatype *)0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue