mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Inform decompiler when opaque data-types are variable length
This commit is contained in:
parent
df676270e4
commit
71ca7532e7
1 changed files with 5 additions and 0 deletions
|
@ -588,8 +588,10 @@ public class PcodeDataTypeManager {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int sz = type.getLength();
|
int sz = type.getLength();
|
||||||
|
boolean isVarLength = false;
|
||||||
if (sz <= 0) {
|
if (sz <= 0) {
|
||||||
sz = size;
|
sz = size;
|
||||||
|
isVarLength = true;
|
||||||
}
|
}
|
||||||
appendNameIdAttributes(resBuf, origType);
|
appendNameIdAttributes(resBuf, origType);
|
||||||
if (sz < 16) {
|
if (sz < 16) {
|
||||||
|
@ -601,6 +603,9 @@ public class PcodeDataTypeManager {
|
||||||
// Build an "opaque" structure with no fields
|
// Build an "opaque" structure with no fields
|
||||||
SpecXmlUtils.encodeStringAttribute(resBuf, "metatype", "struct");
|
SpecXmlUtils.encodeStringAttribute(resBuf, "metatype", "struct");
|
||||||
SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "size", sz);
|
SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "size", sz);
|
||||||
|
if (isVarLength) {
|
||||||
|
SpecXmlUtils.encodeBooleanAttribute(resBuf, "varlength", isVarLength);
|
||||||
|
}
|
||||||
resBuf.append('>');
|
resBuf.append('>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue