GP-5216 Correct BSim signature apply bug

This commit is contained in:
ghidra1
2024-12-21 09:32:49 -05:00
parent d3e34f97cc
commit dacc9b226d

View File

@@ -381,16 +381,17 @@ public class FunctionUtility {
return sourceConv;
}
boolean applyConventionName = sameLanguageAndCompilerSpec;
if (applyConventionName) {
String callingConvention = sourceFunction.getCallingConventionName();
if (applyConventionName &&
!CompilerSpec.CALLING_CONVENTION_default.equals(callingConvention)) {
DataTypeManager dtMgr = destinationFunction.getProgram().getDataTypeManager();
String name = destinationFunction.getCallingConventionName();
if (GenericCallingConvention
.getGenericCallingConvention(name) == GenericCallingConvention.unknown &&
!dtMgr.getKnownCallingConventionNames().contains(name)) {
if (GenericCallingConvention.getGenericCallingConvention(
callingConvention) == GenericCallingConvention.unknown &&
!dtMgr.getKnownCallingConventionNames().contains(callingConvention)) {
applyConventionName = false;
}
}
return applyConventionName ? sourceFunction.getCallingConventionName()
return applyConventionName ? callingConvention
: destinationFunction.getCallingConventionName();
}