Skip to content

Ghidra is a software reverse engineering (SRE) framework

GT-3244 corrected composite transition bug for BitFieldPlacementComponent

ghidra1ccfd801521d3
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 efcf2aa9a6..38d786f9ac 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
@@ -155,6 +155,9 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable {
}
allocationByteOffset = 0;
allocationByteSize = 1;
+ if (!editUseEnabled) {
+ allocationByteSize = composite.getLength();
+ }
init(null);
}
@@ -982,10 +985,6 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable {
return;
}
- leftChopBytes = getLeftByteChop();
- rightChopBytes = getRightByteChop();
- allocationBytes = allocationByteSize - leftChopBytes - rightChopBytes;
-
bitAttributes = new BitAttributes[8 * allocationBytes];
if (composite instanceof Structure) {