mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
ceEmitContext null check
This commit is contained in:
parent
023b20dfee
commit
fa256701c7
1 changed files with 10 additions and 1 deletions
|
@ -2792,9 +2792,18 @@ void BfModule::ExecuteCEOnCompile(CeEmitContext* ceEmitContext, BfTypeInstance*
|
|||
if (useTypeInstance->IsUnspecializedTypeVariation())
|
||||
useTypeInstance = GetUnspecializedTypeInstance(useTypeInstance);
|
||||
|
||||
SetAndRestoreValue<BfType*> prevTypeInstance(ceEmitContext->mType, useTypeInstance);
|
||||
BfType* prevContextTypeInstance = NULL;
|
||||
if (ceEmitContext != NULL)
|
||||
{
|
||||
prevContextTypeInstance = ceEmitContext->mType;
|
||||
ceEmitContext->mType = useTypeInstance;
|
||||
}
|
||||
|
||||
methodInstance = GetRawMethodInstanceAtIdx(useTypeInstance, methodDef->mIdx);
|
||||
result = mCompiler->mCeMachine->Call(methodDef->GetRefNode(), this, methodInstance, {}, (CeEvalFlags)(CeEvalFlags_PersistantError | CeEvalFlags_DeferIfNotOnlyError), NULL);
|
||||
|
||||
if (ceEmitContext != NULL)
|
||||
ceEmitContext->mType = prevContextTypeInstance;
|
||||
}
|
||||
|
||||
if ((onCompileKind == BfCEOnCompileKind_TypeDone) && (typeInstance->mDefineState > BfTypeDefineState_CETypeInit))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue