mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
0f335d0250
4 changed files with 75 additions and 55 deletions
|
@ -774,7 +774,7 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
|||
private DataType resolveBitFieldDataType(BitFieldDataType bitFieldDataType,
|
||||
DataTypeConflictHandler handler) {
|
||||
|
||||
// NOTE: When a bit-field is getting adding added it will get resolved more than once.
|
||||
// NOTE: When a bit-field is getting added it will get resolved more than once.
|
||||
// The first time we will ensure that the base data type, which may be a TypeDef, gets
|
||||
// resolved. If the bit-offset is too large it will be set to 0
|
||||
// with the expectation that it will get corrected during subsequent packing.
|
||||
|
@ -788,7 +788,8 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
|||
int storageSizeBits = 8 * storageSize;
|
||||
if ((bitOffset + bitSize) > storageSizeBits) {
|
||||
// should get recomputed during packing when used within aligned structure
|
||||
bitOffset = getDataOrganization().isBigEndian() ? baseLengthBits - bitSize : 0;
|
||||
int effectiveBitSize = Math.min(bitSize, baseLengthBits);
|
||||
bitOffset = getDataOrganization().isBigEndian() ? baseLengthBits - effectiveBitSize : 0;
|
||||
storageSize = baseLength;
|
||||
}
|
||||
try {
|
||||
|
|
|
@ -997,10 +997,7 @@ class StructureDB extends CompositeDB implements Structure {
|
|||
if (ordinal < 0 || ordinal >= numComponents) {
|
||||
throw new ArrayIndexOutOfBoundsException(ordinal);
|
||||
}
|
||||
if (dataType instanceof BitFieldDataType) {
|
||||
throw new IllegalArgumentException(
|
||||
"Components may not be replaced with a bit-field");
|
||||
}
|
||||
|
||||
validateDataType(dataType);
|
||||
|
||||
DataTypeComponent origDtc = getComponent(ordinal);
|
||||
|
@ -1044,9 +1041,7 @@ class StructureDB extends CompositeDB implements Structure {
|
|||
throw new IllegalArgumentException(
|
||||
"Offset " + offset + " is beyond end of structure (" + structLength + ").");
|
||||
}
|
||||
if (dataType instanceof BitFieldDataType) {
|
||||
throw new IllegalArgumentException("Components may not be replaced with a bit-field");
|
||||
}
|
||||
|
||||
lock.acquire();
|
||||
try {
|
||||
checkDeleted();
|
||||
|
|
|
@ -1154,9 +1154,6 @@ public class StructureDataType extends CompositeDataTypeImpl implements Structur
|
|||
if (index < 0 || index >= numComponents) {
|
||||
throw new ArrayIndexOutOfBoundsException(index);
|
||||
}
|
||||
if (dataType instanceof BitFieldDataType) {
|
||||
throw new IllegalArgumentException("Components may not be replaced with a bit-field");
|
||||
}
|
||||
|
||||
validateDataType(dataType);
|
||||
|
||||
|
@ -1196,9 +1193,6 @@ public class StructureDataType extends CompositeDataTypeImpl implements Structur
|
|||
throw new IllegalArgumentException(
|
||||
"Offset " + offset + " is beyond end of structure (" + structLength + ").");
|
||||
}
|
||||
if (dataType instanceof BitFieldDataType) {
|
||||
throw new IllegalArgumentException("Components may not be replaced with a bit-field");
|
||||
}
|
||||
|
||||
validateDataType(dataType);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue