Ghidra is a software reverse engineering (SRE) framework
GP-4020 Send core data-type id as unsigned
caheckman053097616a26
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.ccindex 118bf74e9a..0c16011bf1 100644--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc@@ -3021,7 +3021,7 @@ Datatype *TypeFactory::findAdd(Datatype &ct)if (ct.name.size()!=0) { // If there is a nameif (ct.id == 0) // There must be an id- throw LowlevelError("Datatype must have a valid id");+ throw LowlevelError("Datatype must have a valid id: "+ct.name);res = findByIdLocal(ct.name,ct.id); // Lookup type by itif (res != (Datatype *)0) { // If a type has this nameif (0!=res->compareDependency( ct )) // Check if it is the same typediff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.javaindex 2207edb9e0..9b9c3c1dc9 100644--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java@@ -1215,7 +1215,7 @@ public class PcodeDataTypeManager {}/**- * Encode the coretypes to the stream+ * Encode the core data-types to the stream* @param encoder is the stream encoder* @throws IOException for errors in the underlying stream*/@@ -1233,8 +1233,7 @@ public class PcodeDataTypeManager {if (typeMap.isUtf) {encoder.writeBool(ATTRIB_UTF, true);}- // Encode special id ( <0 for builtins )- encoder.writeSignedInteger(ATTRIB_ID, typeMap.id);+ encoder.writeUnsignedInteger(ATTRIB_ID, typeMap.id);encoder.closeElement(ELEM_TYPE);}encoder.closeElement(ELEM_CORETYPES);