aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-08-26 17:31:06 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-08-26 17:31:06 +0000
commit98f9e94e57d62170ee5c7dcd4e4d90ddb84baf2d (patch)
tree2db9dc7715e31e6f6d018ccdb737a8079c70a69d /clang/lib/Basic/FileManager.cpp
parentb1c90791024b2128132449ded873856114c96196 (diff)
downloadllvm-98f9e94e57d62170ee5c7dcd4e4d90ddb84baf2d.zip
llvm-98f9e94e57d62170ee5c7dcd4e4d90ddb84baf2d.tar.gz
llvm-98f9e94e57d62170ee5c7dcd4e4d90ddb84baf2d.tar.bz2
Fix use of invalidated iterator introduced by r369680.
llvm-svn: 369932
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index 7138f667..649e4d2 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -263,15 +263,15 @@ FileManager::getFileRef(StringRef Filename, bool openFile, bool CacheFailure) {
// If the name returned by getStatValue is different than Filename, re-intern
// the name.
if (Status.getName() != Filename) {
- auto &NamedFileEnt =
+ auto &NewNamedFileEnt =
*SeenFileEntries.insert({Status.getName(), &UFE}).first;
- assert((*NamedFileEnt.second).get<FileEntry *>() == &UFE &&
+ assert((*NewNamedFileEnt.second).get<FileEntry *>() == &UFE &&
"filename from getStatValue() refers to wrong file");
- InterndFileName = NamedFileEnt.first().data();
+ InterndFileName = NewNamedFileEnt.first().data();
// In addition to re-interning the name, construct a redirecting seen file
// entry, that will point to the name the filesystem actually wants to use.
StringRef *Redirect = new (CanonicalNameStorage) StringRef(InterndFileName);
- SeenFileInsertResult.first->second = Redirect;
+ NamedFileEnt.second = Redirect;
}
if (UFE.isValid()) { // Already have an entry with this inode, return it.