From ab31e5bc89a0c4304d9716f9cb09614583ab5c3e Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sat, 27 Apr 2024 09:45:32 -0400 Subject: [PATCH] mIgnoreWrites fix in CeContext::Execute --- IDEHelper/Compiler/CeMachine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index adbd3768..6fd9e073 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -5069,6 +5069,8 @@ BfTypedValue CeContext::Call(CeCallSource callSource, BfModule* module, BfMethod } } + //auto ceModule = mCeMachine->mCeModule; + AutoTimer autoTimer(mCeMachine->mRevisionExecuteTime); @@ -5776,6 +5778,7 @@ public: bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* startFramePtr, BfType*& returnType, BfType*& castReturnType) { auto ceModule = mCeMachine->mCeModule; + SetAndRestoreValue ignoreWrites(ceModule->mBfIRBuilder->mIgnoreWrites, false); CeFunction* ceFunction = startFunction; returnType = startFunction->mMethodInstance->mReturnType; uint8* memStart = &mMemory[0]; @@ -8197,6 +8200,11 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* if (moduleMethodInstance) { auto ceFunction = mCeMachine->QueueMethod(moduleMethodInstance.mMethodInstance, moduleMethodInstance.mFunc); + if (ceFunction == NULL) + { + _Fail("Method generation failed"); + return false; + } ceFunction->mCeFunctionInfo->mRefCount++; mCeMachine->DerefMethodInfo(callEntry.mFunctionInfo); callEntry.mFunctionInfo = ceFunction->mCeFunctionInfo;