Skip to content

Commit ada22c8

Browse files
committed
Fix "pointer is null" static analyzer warning. NFCI.
1 parent 2bfee35 commit ada22c8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/include/clang/Basic/SourceManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
831831
FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos,
832832
SrcMgr::CharacteristicKind FileCharacter,
833833
int LoadedID = 0, unsigned LoadedOffset = 0) {
834+
assert(SourceFile && "Null source file!");
834835
const SrcMgr::ContentCache *IR =
835836
getOrCreateContentCache(SourceFile, isSystem(FileCharacter));
836837
assert(IR && "getOrCreateContentCache() cannot return NULL");

0 commit comments

Comments
 (0)