Prechádzať zdrojové kódy

Fixed field initializer crash

Brian Fiete 5 rokov pred
rodič
commit
a29f22d227
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      IDEHelper/Compiler/BfModule.cpp

+ 2 - 2
IDEHelper/Compiler/BfModule.cpp

@@ -3802,10 +3802,10 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
 	if (fieldInstance != NULL)
 	if (fieldInstance != NULL)
 		MarkFieldInitialized(fieldInstance);
 		MarkFieldInitialized(fieldInstance);
 
 
-	if (doStore)
+	if ((doStore) && (result))
 	{
 	{
 		result = LoadValue(result);
 		result = LoadValue(result);
-		if (!result.mType->IsValuelessType())		
+		if (!result.mType->IsValuelessType())
 			mBfIRBuilder->CreateStore(result.mValue, staticVarRef.mValue);		
 			mBfIRBuilder->CreateStore(result.mValue, staticVarRef.mValue);		
 	}
 	}