diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-11 14:34:14 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-11 14:34:14 +0000 |
commit | 256454fdaa4d3d044a80c2991b210ca3d2bf2a24 (patch) | |
tree | 9b5b2b53a26df69747a82bf429ba63abd5332635 /clang/tools/libclang/Indexing.cpp | |
parent | e5a447d947ebbd622757fb19e424c0ee5445bbcb (diff) | |
download | bcm5719-llvm-256454fdaa4d3d044a80c2991b210ca3d2bf2a24.tar.gz bcm5719-llvm-256454fdaa4d3d044a80c2991b210ca3d2bf2a24.zip |
libclang: audit all APIs that accept a CXTranslationUnit to make sure that
checks for invalid translation unit are in place. Also, while there, add log
output for this case.
llvm-svn: 201155
Diffstat (limited to 'clang/tools/libclang/Indexing.cpp')
-rw-r--r-- | clang/tools/libclang/Indexing.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp index 99fcdb692ad..7fb27bf258c 100644 --- a/clang/tools/libclang/Indexing.cpp +++ b/clang/tools/libclang/Indexing.cpp @@ -756,8 +756,10 @@ static void clang_indexTranslationUnit_Impl(void *UserData) { unsigned index_options = ITUI->index_options; ITUI->result = 1; // init as error. - if (!TU) + if (isNotUseableTU(TU)) { + LOG_BAD_TU(TU); return; + } if (!client_index_callbacks || index_callbacks_size == 0) return; |