mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GT-3032 exclude flexible array component from list of components passed
to structure packer
This commit is contained in:
@@ -59,8 +59,7 @@ class AlignedComponentPacker {
|
||||
* @param isLastComponent true if dtc is the last component within the structure
|
||||
*/
|
||||
void addComponent(InternalDataTypeComponent dtc, boolean isLastComponent) {
|
||||
if (dtc.getDataType() == DataType.DEFAULT ||
|
||||
(dtc.isFlexibleArrayComponent() && !isLastComponent)) {
|
||||
if (dtc.getDataType() == DataType.DEFAULT || dtc.isFlexibleArrayComponent()) {
|
||||
throw new IllegalArgumentException("unsupported component");
|
||||
}
|
||||
if (!packComponent(dtc)) {
|
||||
|
||||
@@ -26,7 +26,8 @@ import ghidra.util.exception.DuplicateNameException;
|
||||
/**
|
||||
* <code>AlignedStructureInspector</code> provides a simple instance of a structure
|
||||
* member container used to perform alignment operations without forcing modification
|
||||
* of the actual structure.
|
||||
* of the actual structure. A wrapper is not used for the flexible array component
|
||||
* which will not be modified by packer.
|
||||
*/
|
||||
public class AlignedStructureInspector extends AlignedStructurePacker {
|
||||
|
||||
@@ -39,9 +40,6 @@ public class AlignedStructureInspector extends AlignedStructurePacker {
|
||||
for (DataTypeComponent c : structure.getComponents()) {
|
||||
list.add(new ReadOnlyComponentWrapper(c));
|
||||
}
|
||||
if (structure.hasFlexibleArrayComponent()) {
|
||||
list.add(new ReadOnlyComponentWrapper(structure.getFlexibleArrayComponent()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user