From ff7a9896cd1ca7b4a3d5d0a42b07a7679a804994 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 7 Mar 2025 12:01:29 -0800 Subject: [PATCH] FinishInit check in CreateFunctionFrom --- IDEHelper/Compiler/BfModule.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 47795264..c3067bee 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -1110,6 +1110,8 @@ bool BfModule::IsHotCompile() void BfModule::FinishInit() { + BfLogSysM("FinishInit %@ %s\n", this, mModuleName.c_str()); + BF_ASSERT(mAwaitingInitFinish); auto moduleOptions = GetModuleOptions(); @@ -11483,6 +11485,9 @@ BfIRValue BfModule::CreateFunctionFrom(BfMethodInstance* methodInstance, bool tr return BfIRValue(); } + if ((mAwaitingInitFinish) && (!mBfIRBuilder->mIgnoreWrites)) + FinishInit(); + auto methodDef = methodInstance->mMethodDef; StringT<4096> methodName; BfMangler::Mangle(methodName, mCompiler->GetMangleKind(), methodInstance);