Merge remote-tracking branch

'origin/GP-1111_ghidra1_PropogateStructPackSetting' into patch (Closes
#3193)
This commit is contained in:
ghidra1 2021-08-02 17:06:58 -04:00
commit 10db074bcc
2 changed files with 19 additions and 7 deletions

View file

@ -238,9 +238,19 @@ public class StructureFactory {
throw new IllegalArgumentException("No data type components found");
}
for (int i = 0; i < dataComps.length; i++) {
structure.add(dataComps[i].getDataType(), dataComps[i].getLength(),
dataComps[i].getFieldName(), dataComps[i].getComment());
// adopt pack settings from parent - things could move as a result
DataType parent = dataComps[0].getParent();
if (parent instanceof Composite) {
Composite c = (Composite) parent;
structure.setPackingEnabled(c.isPackingEnabled());
if (c.getPackingType() == PackingType.EXPLICIT) {
structure.setExplicitPackingValue(c.getExplicitPackingValue());
}
}
for (DataTypeComponent dataComp : dataComps) {
structure.add(dataComp.getDataType(), dataComp.getLength(),
dataComp.getFieldName(), dataComp.getComment());
}
}
}