From 28fa77feeb7db46abea1a6699d7a88a02d8dab46 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 13 Oct 2021 11:23:46 +0200 Subject: [PATCH] [clang][modules] Avoid using uninitialized SourceLocation At this point, `F.ImportLoc` has not been initialized by the `ASTReader` yet and using it leads to an assertion failure. Introduced in 638c673a8c3e27b6532049ac17ac9bc96640fc45 and 444513510999e4c1ea23253654196793834d53bf. --- clang/lib/Serialization/ASTReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 563a76cd380a3..dc78e442a6951 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2924,7 +2924,7 @@ ASTReader::ReadControlBlock(ModuleFile &F, // If we've already loaded a module map file covering this module, we may // have a better path for it (relative to the current build). Module *M = PP.getHeaderSearchInfo().lookupModule( - F.ModuleName, F.ImportLoc, /*AllowSearch*/ true, + F.ModuleName, SourceLocation(), /*AllowSearch*/ true, /*AllowExtraModuleMapSearch*/ true); if (M && M->Directory) { // If we're implicitly loading a module, the base directory can't