mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
BitFields - additional refinements
This commit is contained in:
parent
286d2a6258
commit
3f1ffb276f
4 changed files with 124 additions and 39 deletions
|
@ -377,13 +377,16 @@ class StructureDB extends CompositeDB implements Structure {
|
|||
int endIndex = startIndex;
|
||||
if (startIndex < components.size()) {
|
||||
// some shifting of components may be required
|
||||
int endBitOffset = startBitOffset + effectiveBitSize - 1;
|
||||
endIndex = Collections.binarySearch(components, new Integer(endBitOffset),
|
||||
int endBitOffset = startBitOffset;
|
||||
if (effectiveBitSize != 0) {
|
||||
endBitOffset += effectiveBitSize - 1;
|
||||
}
|
||||
endIndex = Collections.binarySearch(components, Integer.valueOf(endBitOffset),
|
||||
bitOffsetComparator);
|
||||
if (endIndex < 0) {
|
||||
endIndex = -endIndex - 1;
|
||||
}
|
||||
else {
|
||||
else if (effectiveBitSize != 0) {
|
||||
hasConflict = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -574,13 +574,16 @@ public class StructureDataType extends CompositeDataTypeImpl implements Structur
|
|||
int endIndex = startIndex;
|
||||
if (startIndex < components.size()) {
|
||||
// some shifting of components may be required
|
||||
int endBitOffset = startBitOffset + effectiveBitSize - 1;
|
||||
endIndex = Collections.binarySearch(components, new Integer(endBitOffset),
|
||||
int endBitOffset = startBitOffset;
|
||||
if (effectiveBitSize != 0) {
|
||||
endBitOffset += effectiveBitSize - 1;
|
||||
}
|
||||
endIndex = Collections.binarySearch(components, Integer.valueOf(endBitOffset),
|
||||
bitOffsetComparator);
|
||||
if (endIndex < 0) {
|
||||
endIndex = -endIndex - 1;
|
||||
}
|
||||
else {
|
||||
else if (effectiveBitSize != 0) {
|
||||
hasConflict = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue