From 58979f64076e65c19193526e65ec8755fd33f6cc Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 23 Jan 2025 07:43:31 -0800 Subject: [PATCH] CeOp_GetMethod_Virt fix with non-method-populated type --- IDEHelper/Compiler/CeMachine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index eb7bca98..5c0d1b5d 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -8647,7 +8647,10 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* _Fail("Empty virtual table"); return false; } - auto methodInstance = (BfMethodInstance*)valueType->mVirtualMethodTable[virtualIdx].mImplementingMethod; + auto& methodRef = valueType->mVirtualMethodTable[virtualIdx].mImplementingMethod; + if (methodRef.mTypeInstance->mDefineState < BfTypeDefineState_DefinedAndMethodsSlotted) + ceModule->PopulateType(methodRef.mTypeInstance, BfPopulateType_DataAndMethods); + auto methodInstance = (BfMethodInstance*)methodRef; auto callFunction = mCeMachine->GetPreparedFunction(methodInstance); if (needsFunctionIds)