mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GT-3151 Correct PDB composite buildup error involving bitfields
This commit is contained in:
@@ -1084,6 +1084,7 @@ class DefaultCompositeMember extends CompositeMember {
|
||||
// must remove sibling bit fields at same offset but must leave
|
||||
// first one behind to facilitate subsequent component swap.
|
||||
boolean skipIfEqual = true;
|
||||
int truncateOrdinal = -1;
|
||||
for (DataTypeComponent component : parentStruct.getComponents()) {
|
||||
int offset = component.getOffset();
|
||||
if (offset >= memberOffset) {
|
||||
@@ -1091,11 +1092,18 @@ class DefaultCompositeMember extends CompositeMember {
|
||||
skipIfEqual = false;
|
||||
}
|
||||
else {
|
||||
parentStruct.clearComponent(component.getOrdinal());
|
||||
if (truncateOrdinal < 0) {
|
||||
truncateOrdinal = component.getOrdinal();
|
||||
}
|
||||
parent.structureMemberOffsetMap.remove(offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (truncateOrdinal >= 0) {
|
||||
while (parentStruct.getNumComponents() > truncateOrdinal) {
|
||||
parentStruct.delete(truncateOrdinal);
|
||||
}
|
||||
}
|
||||
|
||||
parent.structureMemberRangeMap.paintRange(memberOffset + getLength(), parent.getLength(),
|
||||
-1);
|
||||
|
||||
Reference in New Issue
Block a user