projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5178942
)
Eliminate a race condition with the global module index.
author
Douglas Gregor
<dgregor@apple.com>
Wed, 6 Feb 2013 18:08:37 +0000
(18:08 +0000)
committer
Douglas Gregor
<dgregor@apple.com>
Wed, 6 Feb 2013 18:08:37 +0000
(18:08 +0000)
Essentially, a module file on disk could change size between the time
we stat() it and the time we open it, and we need to be robust against
such a problem.
llvm-svn: 174529
clang/lib/Serialization/GlobalModuleIndex.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Serialization/GlobalModuleIndex.cpp
b/clang/lib/Serialization/GlobalModuleIndex.cpp
index
72165bc
..
5b2ab91
100644
(file)
--- a/
clang/lib/Serialization/GlobalModuleIndex.cpp
+++ b/
clang/lib/Serialization/GlobalModuleIndex.cpp
@@
-536,7
+536,8
@@
namespace {
bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) {
// Open the module file.
OwningPtr<llvm::MemoryBuffer> Buffer;
- Buffer.reset(FileMgr.getBufferForFile(File));
+ std::string ErrorStr;
+ Buffer.reset(FileMgr.getBufferForFile(File, &ErrorStr, /*isVolatile=*/true));
if (!Buffer) {
return true;
}