diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java b/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java index 01e101a9fa7..7a60365e42e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java @@ -381,16 +381,17 @@ private static String determineCallingConventionName(Function destinationFunctio 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(); }