GP-1320 corrected DTM used when Function Editor parses signature

This commit is contained in:
ghidra1
2021-09-23 23:02:55 -04:00
parent edbad32508
commit 3f25f75782
3 changed files with 4 additions and 3 deletions
@@ -206,7 +206,7 @@ public class FunctionSignatureParser {
// attempt to separate trailing parameter name from datatype and reparse // attempt to separate trailing parameter name from datatype and reparse
int spaceIndex = arg.lastIndexOf(' '); int spaceIndex = arg.lastIndexOf(' ');
if (spaceIndex < 0) { if (spaceIndex < 0) {
throw new ParseException("Can't resolve datatype: " + dt); throw new ParseException("Can't resolve datatype: " + arg);
} }
int starIndex = arg.lastIndexOf('*'); int starIndex = arg.lastIndexOf('*');
int nameIndex = Math.max(spaceIndex, starIndex) + 1; int nameIndex = Math.max(spaceIndex, starIndex) + 1;
@@ -416,7 +416,7 @@ public class DataTypeParser {
// handle C primitives (e.g. long long, unsigned long int, etc.) // handle C primitives (e.g. long long, unsigned long int, etc.)
DataType dataType = DataTypeUtilities.getCPrimitiveDataType(baseName); DataType dataType = DataTypeUtilities.getCPrimitiveDataType(baseName);
if (dataType != null) { if (dataType != null) {
return dataType; return dataType.clone(dtm);
} }
dtm.findDataTypes(baseName, list); dtm.findDataTypes(baseName, list);
@@ -48,7 +48,8 @@ public class ParameterDefinitionImpl implements ParameterDefinition {
* @throws IllegalArgumentException if invalid parameter datatype specified * @throws IllegalArgumentException if invalid parameter datatype specified
*/ */
protected ParameterDefinitionImpl(String name, DataType dataType, String comment, int ordinal) { protected ParameterDefinitionImpl(String name, DataType dataType, String comment, int ordinal) {
this.dataType = validateDataType(dataType, null, false); this.dataType = validateDataType(dataType,
dataType != null ? dataType.getDataTypeManager() : null, false);
this.name = name; this.name = name;
this.comment = comment; this.comment = comment;
this.ordinal = ordinal; this.ordinal = ordinal;