1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Fixed invalid autocomplete comptime generation

This commit is contained in:
Brian Fiete 2021-12-20 12:03:09 -05:00
parent 397257eba2
commit f53877dc63
2 changed files with 26 additions and 9 deletions

View file

@ -18478,6 +18478,11 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup)
{
BP_ZONE_F("BfModule::ProcessMethod %s", BP_DYN_STR(methodInstance->mMethodDef->mName.c_str()));
if (mIsComptimeModule)
{
BF_ASSERT(!mCompiler->IsAutocomplete());
}
if (mAwaitingInitFinish)
FinishInit();

View file

@ -5,6 +5,7 @@
#include "BfParser.h"
#include "BfReducer.h"
#include "BfExprEvaluator.h"
#include "BfResolvePass.h"
#include "../Backend/BeIRCodeGen.h"
#include "BeefySysLib/platform/PlatformHelper.h"
@ -1332,15 +1333,21 @@ void CeBuilder::Build()
mCeMachine->mCeModule->mStaticFieldRefs.Clear();
int startFunctionCount = (int)beModule->mFunctions.size();
///
{
BfAutoComplete* prevAutoComplete = NULL;
if (mCeMachine->mCeModule->mCompiler->mResolvePassData != NULL)
{
prevAutoComplete = mCeMachine->mCeModule->mCompiler->mResolvePassData->mAutoComplete;
mCeMachine->mCeModule->mCompiler->mResolvePassData->mAutoComplete = NULL;
}
ProcessMethod(methodInstance, &dupMethodInstance);
if (mCeMachine->mCeModule->mCompiler->mResolvePassData != NULL)
mCeMachine->mCeModule->mCompiler->mResolvePassData->mAutoComplete = prevAutoComplete;
}
if (mCeFunction->mInitializeState == CeFunction::InitializeState_Initialized)
return;
if (methodInstance->mMethodDef->mName == "DecodeToUTF8")
{
NOP;
}
if (!dupMethodInstance.mIRFunction)
{
mCeFunction->mFailed = true;
@ -4653,12 +4660,12 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
if (ceModule->mSystem->mPtrSize == 4)
{
int32 intVal = *(int32*)((uint8*)stackPtr + 0);
OutputDebugStrF("Debug Val: %d\n", intVal);
OutputDebugStrF("Debug Val: %d %X\n", intVal, intVal);
}
else
{
int64 intVal = *(int64*)((uint8*)stackPtr + 0);
OutputDebugStrF("Debug Val: %lld\n", intVal);
OutputDebugStrF("Debug Val: %lld %llX\n", intVal, intVal);
}
}
else if (checkFunction->mFunctionKind == CeFunctionKind_GetReflectType)
@ -5379,6 +5386,11 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
++instIdx;
if (ceFunction->mMethodInstance->mMethodDef->mName == "ReadAll")
{
NOP;
}
if (instIdx >= /*0xBC0*/0xBA0)
{
NOP;