Skip to content

Commit

Permalink
[clang][modules] Avoid using uninitialized SourceLocation
Browse files Browse the repository at this point in the history
At this point, `F.ImportLoc` has not been initialized by the `ASTReader` yet and using it leads to an assertion failure.

Introduced in 638c673 and 4445135.
  • Loading branch information
jansvoboda11 committed Oct 13, 2021
1 parent 6f5c685 commit 28fa77f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Serialization/ASTReader.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 28fa77f

Please sign in to comment.