From 01a4703198bcef6c8e9075d6f69fea09751fa1ec Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Tue, 7 Jan 2025 16:28:25 -0500 Subject: [PATCH] GP-0 Corrected minor issue with BitFieldPlacementComponent --- .../core/compositeeditor/BitFieldPlacementComponent.java | 2 +- .../app/plugin/core/compositeeditor/CompEditorPanel.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java index dc3ef675fe..8bb19bdd7a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java @@ -1105,7 +1105,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { int allocationEndOffset = offset + allocationBytes - 1; int numComponents = struct.getNumComponents(); - DataTypeComponent component = struct.getDefinedComponentAtOrAfterOffset(offset); + DataTypeComponent component = struct.getComponentContaining(offset); while (component != null) { if (component.getOffset() > allocationEndOffset) { break; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java index 600aa5b210..087be34bad 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java @@ -195,9 +195,6 @@ public class CompEditorPanel extends CompositeEditorPanel { model.setSelection(new int[] { dtc.getOrdinal() }); table.scrollToSelectedRow(); } - else { - model.setSelection(new FieldSelection()); - } } });