mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Merge remote-tracking branch
'origin/GP-1111_ghidra1_PropogateStructPackSetting' into patch (Closes #3193)
This commit is contained in:
commit
10db074bcc
2 changed files with 19 additions and 7 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue