Sfoglia il codice sorgente

CeOp_GetMethod_Virt fix with non-method-populated type

Brian Fiete 7 mesi fa
parent
commit
58979f6407
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  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");
 				_Fail("Empty virtual table");
 				return false;
 				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);
 			auto callFunction = mCeMachine->GetPreparedFunction(methodInstance);
 			if (needsFunctionIds)
 			if (needsFunctionIds)