GP-4886 Do not assign storage for DEFAULT/unassigned datatype and create

undefined-typedef instead of DWORD-typedef as a default named type when
demangling.
This commit is contained in:
ghidra1 2024-08-30 15:01:43 -04:00
parent 7ec765c854
commit 7128a2adbd
3 changed files with 68 additions and 8 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.
@ -23,8 +23,7 @@ import java.util.ArrayList;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressSpace;
import ghidra.program.model.data.DataType;
import ghidra.program.model.data.DataTypeManager;
import ghidra.program.model.data.*;
import ghidra.program.model.lang.protorules.*;
import ghidra.program.model.listing.Program;
import ghidra.program.model.listing.VariableStorage;
@ -133,6 +132,12 @@ public class ParamListStandard implements ParamList {
if (dt.isZeroLength()) {
return AssignAction.NO_ASSIGNMENT;
}
if (dt == DataType.DEFAULT) {
return AssignAction.NO_ASSIGNMENT;
}
if (dt instanceof TypeDef td && td.getBaseDataType() == DataType.DEFAULT) {
return AssignAction.NO_ASSIGNMENT;
}
for (ModelRule modelRule : modelRules) {
int responseCode = modelRule.assignAddress(dt, proto, pos, dtManager, status, res);
if (responseCode != AssignAction.FAIL) {