mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-12-04 18:13:11 +00:00
GP-3263 - Fixed exception in data type finder
This commit is contained in:
parent
0709537f72
commit
750cfc6994
@ -156,15 +156,20 @@ public abstract class DecompilerReference {
|
|||||||
public static DataType getFieldDataType(ClangFieldToken field) {
|
public static DataType getFieldDataType(ClangFieldToken field) {
|
||||||
DataType fieldDt = field.getDataType();
|
DataType fieldDt = field.getDataType();
|
||||||
fieldDt = DecompilerReference.getBaseType(fieldDt);
|
fieldDt = DecompilerReference.getBaseType(fieldDt);
|
||||||
if (fieldDt instanceof Structure) {
|
if (!(fieldDt instanceof Structure)) {
|
||||||
|
return fieldDt;
|
||||||
|
}
|
||||||
|
|
||||||
Structure parent = (Structure) fieldDt;
|
Structure parent = (Structure) fieldDt;
|
||||||
int offset = field.getOffset();
|
int offset = field.getOffset();
|
||||||
int n = parent.getLength();
|
int n = parent.getLength();
|
||||||
if (offset >= 0 && offset < n) {
|
if (offset >= 0 && offset < n) {
|
||||||
DataTypeComponent dtc = parent.getComponentContaining(field.getOffset());
|
DataTypeComponent dtc = parent.getComponentContaining(field.getOffset());
|
||||||
|
if (dtc != null) {
|
||||||
fieldDt = dtc.getDataType();
|
fieldDt = dtc.getDataType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fieldDt;
|
return fieldDt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user