Skip to content

Ghidra is a software reverse engineering (SRE) framework

Emit opaque structure instead of undefined array

caheckman0f0a82b8b1db
diff --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.java
index 7a1fe9ea3e..fecc0f4cbc 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
@@ -591,19 +591,17 @@ public class PcodeDataTypeManager {
if (sz <= 0) {
sz = size;
}
+ appendNameIdAttributes(resBuf, origType);
if (sz < 16) {
- appendNameIdAttributes(resBuf, origType);
SpecXmlUtils.encodeStringAttribute(resBuf, "metatype", "unknown");
SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "size", sz);
resBuf.append('>');
}
else {
- SpecXmlUtils.encodeStringAttribute(resBuf, "name", "");
- SpecXmlUtils.encodeStringAttribute(resBuf, "metatype", "array");
+ // Build an "opaque" structure with no fields
+ SpecXmlUtils.encodeStringAttribute(resBuf, "metatype", "struct");
SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "size", sz);
- SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "arraysize", sz);
resBuf.append('>');
- resBuf.append(buildTypeRef(new ByteDataType(), 1));
}
}
return resBuf.toString();