GT-3032 corrected aligned structure packer exception triggered by

flexible array
This commit is contained in:
ghidra1 2019-07-24 19:07:15 -04:00
parent d8e9384d4f
commit 7b2d94b3f0

View file

@ -59,7 +59,8 @@ 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()) {
if (dtc.getDataType() == DataType.DEFAULT ||
(dtc.isFlexibleArrayComponent() && !isLastComponent)) {
throw new IllegalArgumentException("unsupported component");
}
if (!packComponent(dtc)) {