diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index f76a1446..e30f545a 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/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; diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index f12e7f03..9186ddcb 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/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();