diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index a6c86296..4fd43582 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -20715,6 +20715,21 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup, return; } + auto _SanityCheckType = [&](BfType* type) + { + if ((type != NULL) && (type->IsDeleting())) + { + InternalError("Method references deleted type", methodDef->GetRefNode()); + return false; + } + return true; + }; + if (!_SanityCheckType(methodInstance->mReturnType)) + return; + for (int paramIdx = 0; paramIdx < methodInstance->GetParamCount(); paramIdx++) + if (!_SanityCheckType(methodInstance->GetParamType(paramIdx))) + return; + StringT<512> mangledName; BfMangler::Mangle(mangledName, mCompiler->GetMangleKind(), mCurMethodInstance); if (!methodInstance->mIRFunction) @@ -26101,6 +26116,15 @@ bool BfModule::SlotVirtualMethod(BfMethodInstance* methodInstance, BfAmbiguityCo continue; } + if (iMethodIdx >= ifaceInst->mMethodInstanceGroups.mSize) + PopulateType(ifaceInst, BfPopulateType_DataAndMethods); + + if (iMethodIdx >= ifaceInst->mMethodInstanceGroups.mSize) + { + InternalError("Interface slotting error", methodInstance->mMethodDef->GetMutNode()); + break; + } + auto& iMethodGroup = ifaceInst->mMethodInstanceGroups[iMethodIdx]; auto iMethodInst = iMethodGroup.mDefault; if (iMethodInst == NULL)