浏览代码

CeOp_GetMethod_Virt fix with non-method-populated type

Brian Fiete 7 月之前
父节点
当前提交
58979f6407
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      IDEHelper/Compiler/CeMachine.cpp

+ 4 - 1
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)