Skip to content

Commit dacc9b2

Browse files
committed
GP-5216 Correct BSim signature apply bug
1 parent d3e34f9 commit dacc9b2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,17 @@ private static String determineCallingConventionName(Function destinationFunctio
381381
return sourceConv;
382382
}
383383
boolean applyConventionName = sameLanguageAndCompilerSpec;
384-
if (applyConventionName) {
384+
String callingConvention = sourceFunction.getCallingConventionName();
385+
if (applyConventionName &&
386+
!CompilerSpec.CALLING_CONVENTION_default.equals(callingConvention)) {
385387
DataTypeManager dtMgr = destinationFunction.getProgram().getDataTypeManager();
386-
String name = destinationFunction.getCallingConventionName();
387-
if (GenericCallingConvention
388-
.getGenericCallingConvention(name) == GenericCallingConvention.unknown &&
389-
!dtMgr.getKnownCallingConventionNames().contains(name)) {
388+
if (GenericCallingConvention.getGenericCallingConvention(
389+
callingConvention) == GenericCallingConvention.unknown &&
390+
!dtMgr.getKnownCallingConventionNames().contains(callingConvention)) {
390391
applyConventionName = false;
391392
}
392393
}
393-
return applyConventionName ? sourceFunction.getCallingConventionName()
394+
return applyConventionName ? callingConvention
394395
: destinationFunction.getCallingConventionName();
395396
}
396397

0 commit comments

Comments
 (0)