Move UNASSIGNED check into LocalSymbolMap

This commit is contained in:
caheckman 2024-10-09 23:03:32 +00:00
parent 38445e387b
commit 33646bbcdc
3 changed files with 16 additions and 22 deletions

View File

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -2470,16 +2470,6 @@ public class FunctionDB extends DatabaseObject implements Function {
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();
}
finally {

View File

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -210,11 +210,12 @@ public class LocalSymbolMap {
pcaddr = pcaddr.subtractWrap(1);
List<HighSymbol> paramList = new ArrayList<>();
boolean internalInvalid = false;
for (int i = 0; i < p.length; ++i) {
Parameter var = p[i];
if (!var.isValid()) {
// TODO: exclude parameters which don't have valid storage ??
continue;
internalInvalid = true;
break;
}
DataType dt = var.getDataType();
String name = var.getName();
@ -243,6 +244,12 @@ public class LocalSymbolMap {
paramSymbol.setNameLock(namelock);
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()];
paramList.toArray(paramSymbols);

View File

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -1145,10 +1145,7 @@ public class PcodeDataTypeManager {
private void generateCoreTypes() {
voidDt = new VoidDataType(progDataTypes);
coreBuiltin = new HashMap<Long, TypeMap>();
TypeMap type = new TypeMap(DataType.DEFAULT, "undefined", "unknown", false, false,
DEFAULT_DECOMPILER_ID);
coreBuiltin.put(type.id, type);
type = new TypeMap(displayLanguage, VoidDataType.dataType, "void", false, false,
TypeMap type = new TypeMap(displayLanguage, VoidDataType.dataType, "void", false, false,
builtInDataTypes);
coreBuiltin.put(type.id, type);