mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-4708 updated createStructure to fix logic error.
This commit is contained in:
parent
184c657cfd
commit
02aba11104
1 changed files with 12 additions and 12 deletions
|
@ -498,16 +498,6 @@ public class RecoveredClass {
|
|||
String fieldName = newComponent.getFieldName();
|
||||
String comment = newComponent.getComment();
|
||||
|
||||
// if it is any empty placeholder structure - replace with
|
||||
// undefined1 dt
|
||||
if (newComponentDataType instanceof Structure &&
|
||||
newComponentDataType.isNotYetDefined()) {
|
||||
|
||||
computedClassStructure.replaceAtOffset(offset, new Undefined1DataType(), 1,
|
||||
fieldName, comment);
|
||||
continue;
|
||||
}
|
||||
|
||||
// if new component is an existing class data type pointer then replace current item
|
||||
// with a void pointer of same size if there is room
|
||||
if (newComponentDataType instanceof Pointer &&
|
||||
|
@ -529,8 +519,18 @@ public class RecoveredClass {
|
|||
// if the new component is a non-empty structure, check to see if the current
|
||||
// structure has undefined or equivalent components and replace with new struct if so
|
||||
if (newComponentDataType instanceof Structure) {
|
||||
|
||||
// if new component is any empty placeholder structure AND if the existing component
|
||||
// is undefined then replace with undefined1 dt
|
||||
if (newComponentDataType.isNotYetDefined()) {
|
||||
if (Undefined.isUndefined(currentComponentDataType)) {
|
||||
computedClassStructure.replaceAtOffset(offset, new Undefined1DataType(), 1,
|
||||
fieldName, comment);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (EditStructureUtils.hasReplaceableComponentsAtOffset(computedClassStructure,
|
||||
offset, (Structure) newComponentDataType, monitor)) {
|
||||
offset, (Structure)newComponentDataType, monitor)) {
|
||||
|
||||
boolean successfulClear =
|
||||
EditStructureUtils.clearLengthAtOffset(computedClassStructure, offset,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue