Skip to content

Commit e250960

Browse files
authored
Merge pull request #5296 from apple/ubuntu-16-10-fix
Initialize CachedVFile with nullptr
2 parents b3dc093 + 09cbffb commit e250960

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/Basic/SourceManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SourceManager {
4040
int LineOffset;
4141
};
4242
std::map<const char *, VirtualFile> VirtualFiles;
43-
mutable std::pair<const char *, const VirtualFile*> CachedVFile = {};
43+
mutable std::pair<const char *, const VirtualFile*> CachedVFile = {nullptr, nullptr};
4444

4545
public:
4646
llvm::SourceMgr &getLLVMSourceMgr() {

lib/Basic/SourceLoc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ bool SourceManager::openVirtualFile(SourceLoc loc, StringRef name,
8282

8383
CharSourceRange range = CharSourceRange(*this, loc, end);
8484
VirtualFiles[end.Value.getPointer()] = { range, name, lineOffset };
85-
CachedVFile = {};
85+
CachedVFile = {nullptr, nullptr};
8686
return true;
8787
}
8888

@@ -99,7 +99,7 @@ void SourceManager::closeVirtualFile(SourceLoc end) {
9999
#endif
100100
return;
101101
}
102-
CachedVFile = {};
102+
CachedVFile = {nullptr, nullptr};
103103

104104
CharSourceRange oldRange = virtualFile->Range;
105105
virtualFile->Range = CharSourceRange(*this, virtualFile->Range.getStart(),

0 commit comments

Comments
 (0)