[Dependency Scanning] Discard and diagnose discovered binary modules built for an incompatible target

Previously the scanner accepted binary modules regardless of what triple they were built for
This commit is contained in:
Artem Chikin
2025-06-26 15:51:44 -07:00
parent d10b3f82fc
commit c8714b5627
8 changed files with 60 additions and 22 deletions

View File

@@ -427,8 +427,8 @@ ModuleFile::getModuleName(ASTContext &Ctx, StringRef modulePath,
serialization::ValidationInfo loadInfo = ModuleFileSharedCore::load(
"", "", std::move(newBuf), nullptr, nullptr,
/*isFramework=*/isFramework, Ctx.SILOpts.EnableOSSAModules,
Ctx.LangOpts.SDKName, Ctx.SearchPathOpts.DeserializedPathRecoverer,
loadedModuleFile);
Ctx.LangOpts.SDKName, Ctx.LangOpts.Target,
Ctx.SearchPathOpts.DeserializedPathRecoverer, loadedModuleFile);
Name = loadedModuleFile->Name.str();
return std::move(moduleBuf.get());
}