Skip to content

Commit b2d5a6d

Browse files
committed
Merge 82194 from mainline.
don't stick an uninitialized 'stat' buf into the stat cache, fill it with zeros. This avoids a GCC warning (PR5000) llvm-svn: 82195
1 parent 18949d7 commit b2d5a6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Basic/FileManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ int MemorizeStatCalls::stat(const char *path, struct stat *buf) {
293293
if (result != 0) {
294294
// Cache failed 'stat' results.
295295
struct stat empty;
296+
memset(&empty, 0, sizeof(empty));
296297
StatCalls[path] = StatResult(result, empty);
297298
}
298299
else if (!S_ISDIR(buf->st_mode) || llvm::sys::Path(path).isAbsolute()) {

0 commit comments

Comments
 (0)