From 6eb1b16aa0eb7e95353abce7545403e67f2336b8 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 20 Nov 2024 09:18:01 -0500 Subject: [PATCH] Fixed cascade invocation with non-addressable target --- IDEHelper/Compiler/BfExprEvaluator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 0e7a2516..3218ac74 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -19044,7 +19044,10 @@ void BfExprEvaluator::DoInvocation(BfAstNode* target, BfMethodBoundExpression* m SetAndRestoreValue prevUsedAsStatement(mUsedAsStatement, mUsedAsStatement || isCascade); SetAndRestoreValue prevEvalExprFlags(mBfEvalExprFlags); if (isCascade) - mBfEvalExprFlags = (BfEvalExprFlags)(mBfEvalExprFlags | BfEvalExprFlags_InCascade); + { + mBfEvalExprFlags = (BfEvalExprFlags)(mBfEvalExprFlags | BfEvalExprFlags_InCascade); + thisValue = mModule->MakeAddressable(thisValue); + } if (((mayBeComptimeCall) && (!mModule->mIsComptimeModule) && (!mModule->mBfIRBuilder->mIgnoreWrites)) || ((mModule->mAttributeState != NULL) && (mModule->mAttributeState->mCustomAttributes != NULL) && (mModule->mAttributeState->mCustomAttributes->Contains(mModule->mCompiler->mConstEvalAttributeTypeDef))))