From 3a261c5dfad120241b8155673fe2d8c26c08fb3c Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sun, 26 Apr 2020 10:27:55 -0700 Subject: [PATCH] Fixed a crash attempting a method call in a const eval --- IDEHelper/Compiler/BfExprEvaluator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 63082e27..a1c9e73a 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -12189,7 +12189,9 @@ BfModuleMethodInstance BfExprEvaluator::GetSelectedMethod(BfAstNode* targetSrc, auto resolvedCurTypeInst = curTypeInst;//mModule->ResolveGenericType(curTypeInst)->ToTypeInstance(); bool hasDifferentResolvedTypes = resolvedCurTypeInst != curTypeInst; BfTypeVector resolvedGenericArguments; - auto rootMethodState = mModule->mCurMethodState->GetRootMethodState(); + BfMethodState* rootMethodState = NULL; + if (mModule->mCurMethodState != NULL) + rootMethodState = mModule->mCurMethodState->GetRootMethodState(); int localInferrableGenericArgCount = -1;