From 3fd7e31119002e6645cc0c64149ae086a10bfe7c Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 5 Jan 2022 08:30:03 -0500 Subject: [PATCH] Fixed invalid clearing of mIsCapturingMethodMatchInfo with inner call --- IDEHelper/Compiler/BfExprEvaluator.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 21818a51..b31c7720 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -6607,12 +6607,19 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu AddCallDependencies(methodInstance); + bool wasCapturingMatchInfo = false; auto autoComplete = GetAutoComplete(); if (autoComplete != NULL) { // Set to false to make sure we don't capture method match info from 'params' array creation + wasCapturingMatchInfo = autoComplete->mIsCapturingMethodMatchInfo; autoComplete->mIsCapturingMethodMatchInfo = false; } + defer( + { + if (autoComplete != NULL) + autoComplete->mIsCapturingMethodMatchInfo = wasCapturingMatchInfo; + }); BfScopeData* boxScopeData = mDeferScopeAlloc; if ((boxScopeData == NULL) && (mModule->mCurMethodState != NULL))