mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Move UNASSIGNED check into LocalSymbolMap
This commit is contained in:
parent
38445e387b
commit
33646bbcdc
3 changed files with 16 additions and 22 deletions
|
@ -2470,16 +2470,6 @@ public class FunctionDB extends DatabaseObject implements Function {
|
||||||
return thunkedFunction.getSignatureSource();
|
return thunkedFunction.getSignatureSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force DEFAULT source if any param has unassigned storage
|
|
||||||
if (!getReturn().isValid()) {
|
|
||||||
return SourceType.DEFAULT;
|
|
||||||
}
|
|
||||||
for (Parameter param : getParameters()) {
|
|
||||||
if (!param.isValid()) {
|
|
||||||
return SourceType.DEFAULT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return getStoredSignatureSource();
|
return getStoredSignatureSource();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
|
@ -210,11 +210,12 @@ public class LocalSymbolMap {
|
||||||
pcaddr = pcaddr.subtractWrap(1);
|
pcaddr = pcaddr.subtractWrap(1);
|
||||||
|
|
||||||
List<HighSymbol> paramList = new ArrayList<>();
|
List<HighSymbol> paramList = new ArrayList<>();
|
||||||
|
boolean internalInvalid = false;
|
||||||
for (int i = 0; i < p.length; ++i) {
|
for (int i = 0; i < p.length; ++i) {
|
||||||
Parameter var = p[i];
|
Parameter var = p[i];
|
||||||
if (!var.isValid()) {
|
if (!var.isValid()) {
|
||||||
// TODO: exclude parameters which don't have valid storage ??
|
internalInvalid = true;
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
DataType dt = var.getDataType();
|
DataType dt = var.getDataType();
|
||||||
String name = var.getName();
|
String name = var.getName();
|
||||||
|
@ -243,6 +244,12 @@ public class LocalSymbolMap {
|
||||||
paramSymbol.setNameLock(namelock);
|
paramSymbol.setNameLock(namelock);
|
||||||
paramSymbol.setTypeLock(lock);
|
paramSymbol.setTypeLock(lock);
|
||||||
}
|
}
|
||||||
|
if (internalInvalid) {
|
||||||
|
// Can only send down a partial prototype. Let decompiler try to recover the whole.
|
||||||
|
for (HighSymbol paramSymbol : paramList) {
|
||||||
|
paramSymbol.setTypeLock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
paramSymbols = new HighSymbol[paramList.size()];
|
paramSymbols = new HighSymbol[paramList.size()];
|
||||||
paramList.toArray(paramSymbols);
|
paramList.toArray(paramSymbols);
|
||||||
|
|
|
@ -1145,10 +1145,7 @@ public class PcodeDataTypeManager {
|
||||||
private void generateCoreTypes() {
|
private void generateCoreTypes() {
|
||||||
voidDt = new VoidDataType(progDataTypes);
|
voidDt = new VoidDataType(progDataTypes);
|
||||||
coreBuiltin = new HashMap<Long, TypeMap>();
|
coreBuiltin = new HashMap<Long, TypeMap>();
|
||||||
TypeMap type = new TypeMap(DataType.DEFAULT, "undefined", "unknown", false, false,
|
TypeMap type = new TypeMap(displayLanguage, VoidDataType.dataType, "void", false, false,
|
||||||
DEFAULT_DECOMPILER_ID);
|
|
||||||
coreBuiltin.put(type.id, type);
|
|
||||||
type = new TypeMap(displayLanguage, VoidDataType.dataType, "void", false, false,
|
|
||||||
builtInDataTypes);
|
builtInDataTypes);
|
||||||
coreBuiltin.put(type.id, type);
|
coreBuiltin.put(type.id, type);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue