From: Douglas Gregor Date: Wed, 6 Feb 2013 18:08:37 +0000 (+0000) Subject: Eliminate a race condition with the global module index. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb680661eb84cb0b034a55678a3445aede52bf8c;p=platform%2Fupstream%2Fllvm.git Eliminate a race condition with the global module index. 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 --- diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 72165bc..5b2ab91 100644 --- 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 Buffer; - Buffer.reset(FileMgr.getBufferForFile(File)); + std::string ErrorStr; + Buffer.reset(FileMgr.getBufferForFile(File, &ErrorStr, /*isVolatile=*/true)); if (!Buffer) { return true; }