]> granicus.if.org Git - clang/commit
Fix use-after-free and spurious error during module load
authorBen Langmuir <blangmuir@apple.com>
Mon, 19 May 2014 16:13:45 +0000 (16:13 +0000)
committerBen Langmuir <blangmuir@apple.com>
Mon, 19 May 2014 16:13:45 +0000 (16:13 +0000)
commit735d818c01a5e1c96a8c30c13993c939b816f42c
treee689896adb057a995e6e944a19e2c3d0923fd93e
parent76790c5cf0edc160c8dadc31ff8d6d439dc8ece1
Fix use-after-free and spurious error during module load

FileManager::invalidateCache is not safe to call when there may be
existing references to the file. What module load failure needs is
to refresh so stale stat() info isn't stored.

This may be the last user of invalidateCache; I'll take a look and
remove it if possible in a future commit.

This caused a use-after-free error as well as a spurious error message
that a module was "found in both 'X.pcm' and 'X.pcm'" in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209138 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Serialization/ModuleManager.cpp
test/Modules/load-after-failure.m [new file with mode: 0644]