1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed some module mutability issues

This commit is contained in:
Brian Fiete 2020-12-03 06:27:10 -08:00
parent adf46175cf
commit 230b71cecb
2 changed files with 15 additions and 4 deletions

View file

@ -12836,8 +12836,14 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
}
else if ((!declareModule->mIsModuleMutable) && (!mCompiler->mIsResolveOnly))
{
BF_ASSERT(!methodInstance->mIsReified);
declareModule = mContext->mUnreifiedModule;
if (!methodInstance->mIsReified)
{
declareModule = mContext->mUnreifiedModule;
}
else
{
declareModule->PrepareForIRWriting(methodInstance->GetOwner());
}
}
SetMethodDependency(methodInstance);
@ -21477,8 +21483,8 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
// we have defined ourselves and which are from the parent module or other extensions
if (!func.IsFake())
{
BF_ASSERT(func);
mFuncReferences[methodInstance] = func;
if (func)
mFuncReferences[methodInstance] = func;
}
}