diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-18 04:51:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-18 04:51:01 +0000 |
commit | f1affe6129442b230d3d09b1938e07a7b341a102 (patch) | |
tree | a52c8af118cc1c45f9d5106df21d03a18ebbc7e0 /lib/Basic/FileManager.cpp | |
parent | 7482e247163978792654ca1a99913e19dd507e0a (diff) |
don't stick an uninitialized 'stat' buf into the stat cache, fill it
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
Diffstat (limited to 'lib/Basic/FileManager.cpp')
-rw-r--r-- | lib/Basic/FileManager.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index e0a7e65756..df86f9d047 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -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()) { |