From ada22c804cd956f3ee7cc9dc82e6d54ead8a4ffe Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 12 Jan 2020 21:43:11 +0000 Subject: [PATCH] Fix "pointer is null" static analyzer warning. NFCI. --- clang/include/clang/Basic/SourceManager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h index ec1b0bcf9897..d87e9ac810fa 100644 --- a/clang/include/clang/Basic/SourceManager.h +++ b/clang/include/clang/Basic/SourceManager.h @@ -831,6 +831,7 @@ public: FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos, SrcMgr::CharacteristicKind FileCharacter, int LoadedID = 0, unsigned LoadedOffset = 0) { + assert(SourceFile && "Null source file!"); const SrcMgr::ContentCache *IR = getOrCreateContentCache(SourceFile, isSystem(FileCharacter)); assert(IR && "getOrCreateContentCache() cannot return NULL");