Brian Fiete 2 hete
szülő
commit
faebf0af06

+ 16 - 0
IDEHelper/Compiler/BfModule.cpp

@@ -14749,6 +14749,22 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
 
 					BfLogSysM("REIFIED(GetMethodInstance QueueSpecializationRequest): %s %s MethodDef:%p RefModule:%s RefMethod:%p\n", TypeToString(typeInst).c_str(), methodDef->mName.c_str(), methodDef, mModuleName.c_str(), mCurMethodInstance);
 
+					// Sanity check
+					{
+						int methodIdx = methodDef->mIdx;
+						BfMethodDef* checkMethod = NULL;
+						if (foreignType != NULL)
+							checkMethod = foreignType->mTypeDef->mMethods[methodIdx];
+						else
+							checkMethod = typeInst->mTypeDef->mMethods[methodIdx];
+						if (checkMethod != methodDef)
+						{
+							BfLogSysM(" MISMATCH. Got:%p Expected:%p\n", checkMethod, methodDef);
+							BF_ASSERT(checkMethod->mName == methodDef->mName);
+							methodDef = checkMethod;
+						}						
+					}
+
 					// This ensures that the method will actually be created when it gets reified
 					BfMethodSpecializationRequest* specializationRequest = mContext->mMethodSpecializationWorkList.Alloc();
 					specializationRequest->mFromModule = typeInst->mModule;

+ 2 - 2
IDEHelper/Compiler/BfModuleTypeUtils.cpp

@@ -5182,9 +5182,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
 
 		bool hadSoftFail = false;
 
-		for (auto& fieldInstanceRef : typeInstance->mFieldInstances)
+		for (int fieldIdx = 0; fieldIdx < typeInstance->mFieldInstances.mSize; fieldIdx++)
 		{
-			auto fieldInstance = &fieldInstanceRef;
+			auto fieldInstance = &typeInstance->mFieldInstances[fieldIdx];
 			auto fieldDef = fieldInstance->GetFieldDef();
 			auto resolvedFieldType = fieldInstance->GetResolvedType();