[clang] 439f574 - [AST] ASTReader::ReadModuleMapFileBlock - assert non-null Module. NFCI.
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 16 04:35:36 PDT 2020
Author: Simon Pilgrim
Date: 2020-09-16T12:30:24+01:00
New Revision: 439f5749d978acfa69f1a2d20c797c3fc0d97989
URL: https://github.com/llvm/llvm-project/commit/439f5749d978acfa69f1a2d20c797c3fc0d97989
DIFF: https://github.com/llvm/llvm-project/commit/439f5749d978acfa69f1a2d20c797c3fc0d97989.diff
LOG: [AST] ASTReader::ReadModuleMapFileBlock - assert non-null Module. NFCI.
At this stage the Module* shouldn't be null - add an assert to fix a clang static analyzer warning.
Added:
Modified:
clang/lib/Serialization/ASTReader.cpp
Removed:
################################################################################
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 6f5fa67117c09..f02c43f337674 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -3950,7 +3950,7 @@ ASTReader::ReadModuleMapFileBlock(RecordData &Record, ModuleFile &F,
return OutOfDate;
}
- assert(M->Name == F.ModuleName && "found module with
diff erent name");
+ assert(M && M->Name == F.ModuleName && "found module with
diff erent name");
// Check the primary module map file.
auto StoredModMap = FileMgr.getFile(F.ModuleMapPath);
More information about the cfe-commits
mailing list