From 2c41b5c3f75616191ae09f87d084da4fbda9b15a Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sun, 25 Oct 2020 10:52:28 -0700 Subject: [PATCH] Fixed FORCELINK sret issue --- IDEHelper/Compiler/BfModule.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index d63b7412..90e1dafe 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -4255,7 +4255,7 @@ void BfModule::CreateFakeCallerMethod(const String& funcName) SizedArray args; BfExprEvaluator exprEvaluator(this); - if (mCurMethodInstance->GetStructRetIdx() != -1) + if (mCurMethodInstance->GetStructRetIdx() == 0) { auto retPtrType = CreatePointerType(mCurMethodInstance->mReturnType); exprEvaluator.PushArg(GetDefaultTypedValue(retPtrType, true, BfDefaultValueKind_Const), args); @@ -4267,6 +4267,12 @@ void BfModule::CreateFakeCallerMethod(const String& funcName) exprEvaluator.PushThis(NULL, thisValue, mCurMethodInstance, args); } + if (mCurMethodInstance->GetStructRetIdx() == 1) + { + auto retPtrType = CreatePointerType(mCurMethodInstance->mReturnType); + exprEvaluator.PushArg(GetDefaultTypedValue(retPtrType, true, BfDefaultValueKind_Const), args); + } + for (int paramIdx = 0; paramIdx < mCurMethodInstance->GetParamCount(); paramIdx++) { auto paramType = mCurMethodInstance->GetParamType(paramIdx);