Browse Source

FinishInit check in CreateFunctionFrom

Brian Fiete 6 tháng trước cách đây
mục cha
commit
ff7a9896cd
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      IDEHelper/Compiler/BfModule.cpp

+ 5 - 0
IDEHelper/Compiler/BfModule.cpp

@@ -1110,6 +1110,8 @@ bool BfModule::IsHotCompile()
 
 
 void BfModule::FinishInit()
 void BfModule::FinishInit()
 {
 {
+	BfLogSysM("FinishInit %@ %s\n", this, mModuleName.c_str());
+
 	BF_ASSERT(mAwaitingInitFinish);
 	BF_ASSERT(mAwaitingInitFinish);
 
 
 	auto moduleOptions = GetModuleOptions();
 	auto moduleOptions = GetModuleOptions();
@@ -11483,6 +11485,9 @@ BfIRValue BfModule::CreateFunctionFrom(BfMethodInstance* methodInstance, bool tr
 		return BfIRValue();
 		return BfIRValue();
 	}
 	}
 
 
+	if ((mAwaitingInitFinish) && (!mBfIRBuilder->mIgnoreWrites))
+		FinishInit();
+
 	auto methodDef = methodInstance->mMethodDef;
 	auto methodDef = methodInstance->mMethodDef;
 	StringT<4096> methodName;
 	StringT<4096> methodName;
 	BfMangler::Mangle(methodName, mCompiler->GetMangleKind(), methodInstance);
 	BfMangler::Mangle(methodName, mCompiler->GetMangleKind(), methodInstance);