Merge remote-tracking branch 'origin/GP-895_EnumOrdering' (Closes #2909)

This commit is contained in:
ghidra1 2021-05-18 08:47:28 -04:00
commit d1c491b357

View file

@ -764,6 +764,9 @@ int4 TypeEnum::compareDependency(const Datatype &op) const
const TypeEnum *te = (const TypeEnum *) &op;
map<uintb,string>::const_iterator iter1,iter2;
if (namemap.size() != te->namemap.size()) {
return (namemap.size() < te->namemap.size()) ? -1 : 1;
}
iter1 = namemap.begin();
iter2 = te->namemap.begin();
while(iter1 != namemap.end()) {
@ -1287,18 +1290,21 @@ void TypeCode::saveXml(ostream &s) const
void TypeCode::restoreXml(const Element *el,TypeFactory &typegrp)
{
const List &list(el->getChildren());
List::const_iterator iter;
iter = list.begin();
if (iter != list.end()) {
// Traditionally a <prototype> tag implies variable length, without a "varlength" attribute
flags |= variable_length;
}
restoreXmlBasic(el);
if (proto != (FuncProto *)0) {
delete proto;
proto = (FuncProto *)0;
}
const List &list(el->getChildren());
List::const_iterator iter;
iter = list.begin();
if (iter == list.end()) return; // No underlying prototype
Architecture *glb = typegrp.getArch();
factory = &typegrp;
flags |= variable_length;
proto = new FuncProto();
proto->setInternal( glb->defaultfp, typegrp.getTypeVoid() );
proto->restoreXml(*iter,glb);