Fix "pointer is null" static analyzer warning. NFCI.

This commit is contained in:
Simon Pilgrim 2020-01-12 21:43:11 +00:00
parent 2bfee35cb8
commit ada22c804c
1 changed files with 1 additions and 0 deletions

View File

@ -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");