1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

PrepareFunction fix during reentry (error condition)

This commit is contained in:
Brian Fiete 2021-11-20 10:39:01 -08:00
parent 238def6389
commit dc57db202d

View file

@ -5466,6 +5466,7 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
{
auto curFrame = _GetCurFrame();
SetAndRestoreValue<CeFrame*> prevFrame(mCurFrame, &curFrame);
BF_ASSERT(!callEntry.mFunction->mInitialized);
mCeMachine->PrepareFunction(callEntry.mFunction, NULL);
}
@ -6915,8 +6916,14 @@ void CeMachine::PrepareFunction(CeFunction* ceFunction, CeBuilder* parentBuilder
AutoTimer autoTimer(mRevisionExecuteTime);
SetAndRestoreValue<CeFunction*> prevCEFunction(mPreparingFunction, ceFunction);
BF_ASSERT(!ceFunction->mInitialized);
if (ceFunction->mFunctionKind == CeFunctionKind_NotSet)
{
CheckFunctionKind(ceFunction);
if (ceFunction->mInitialized)
return;
}
BF_ASSERT(!ceFunction->mInitialized);
ceFunction->mInitialized = true;