From dacc9b226d8a6e5d444bee8fa3f0554a11491bd1 Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Sat, 21 Dec 2024 09:32:49 -0500 Subject: [PATCH] GP-5216 Correct BSim signature apply bug --- .../java/ghidra/program/util/FunctionUtility.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 01e101a9fa..7a60365e42 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 @@ 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(); }