From deaa1b41250070c4a8b206cee56fc602a14489f0 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 21 Mar 2025 08:12:33 -0400 Subject: [PATCH] Delegate calling convention thunk fix --- IDEHelper/Compiler/BfExprEvaluator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 28db0fc1..9eff139e 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -7157,6 +7157,9 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance* expectCallingConvention = BfIRCallingConv_ThisCall; } + if (((callFlags & BfCreateCallFlags_DelegateThunkStatic) != 0) && (expectCallingConvention == BfIRCallingConv_ThisCall)) + expectCallingConvention = BfIRCallingConv_CDecl; + if ((methodInstance->mAlwaysInline) && (mModule->mCompiler->mOptions.mEmitLineInfo)) { // Emit a NOP so we always have a "step over" point