Răsfoiți Sursa

Fixed crash when attempting invocation in const context

Brian Fiete 5 ani în urmă
părinte
comite
81af04a1ce
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      IDEHelper/Compiler/BfExprEvaluator.cpp

+ 3 - 1
IDEHelper/Compiler/BfExprEvaluator.cpp

@@ -5442,11 +5442,13 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
 
 
 		if ((argValue) && (arg != NULL))
 		if ((argValue) && (arg != NULL))
 		{	
 		{	
-			//
+			if (mModule->mCurMethodState != NULL)
 			{
 			{
 				SetAndRestoreValue<BfScopeData*> prevScopeData(mModule->mCurMethodState->mOverrideScope, boxScopeData);
 				SetAndRestoreValue<BfScopeData*> prevScopeData(mModule->mCurMethodState->mOverrideScope, boxScopeData);
 				argValue = mModule->Cast(arg, argValue, wantType);
 				argValue = mModule->Cast(arg, argValue, wantType);
 			}
 			}
+			else
+				argValue = mModule->Cast(arg, argValue, wantType);
 
 
 			if (!argValue)
 			if (!argValue)
 			{
 			{