]> granicus.if.org Git - clang/commitdiff
don't stick an uninitialized 'stat' buf into the stat cache, fill it
authorChris Lattner <sabre@nondot.org>
Fri, 18 Sep 2009 04:51:01 +0000 (04:51 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 18 Sep 2009 04:51:01 +0000 (04:51 +0000)
with zeros.  This avoids a GCC warning (PR5000)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82194 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/FileManager.cpp

index e0a7e657563bee53794be6cc4191667b187db008..df86f9d04702e76a10c51bb41ba3e83751dd9acd 100644 (file)
@@ -295,6 +295,7 @@ int MemorizeStatCalls::stat(const char *path, struct stat *buf) {
   if (result != 0) {
     // Cache failed 'stat' results.
     struct stat empty;
+    memset(&empty, 0, sizeof(empty));
     StatCalls[path] = StatResult(result, empty);
   }
   else if (!S_ISDIR(buf->st_mode) || llvm::sys::Path(path).isAbsolute()) {