diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-04-20 00:21:03 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-04-20 00:21:03 +0000 |
commit | 49f754f423ada6aba2e19ea6a6e8f2659778512c (patch) | |
tree | 5815e6d0ae6b6d6e8bd4050102ba415692c82c17 /clang/tools/libclang/CIndexInclusionStack.cpp | |
parent | cd01ed5bd6134c4dab5e7b7baccef326ca205712 (diff) | |
download | bcm5719-llvm-49f754f423ada6aba2e19ea6a6e8f2659778512c.tar.gz bcm5719-llvm-49f754f423ada6aba2e19ea6a6e8f2659778512c.zip |
Teach SourceManager::getSLocEntry() that it can fail due to problems
during deserialization from a precompiled header, and update all of
its callers to note when this problem occurs and recover (more)
gracefully. Fixes <rdar://problem/9119249>.
llvm-svn: 129839
Diffstat (limited to 'clang/tools/libclang/CIndexInclusionStack.cpp')
-rw-r--r-- | clang/tools/libclang/CIndexInclusionStack.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/tools/libclang/CIndexInclusionStack.cpp b/clang/tools/libclang/CIndexInclusionStack.cpp index 9ea901927f8..6bc4f2e776a 100644 --- a/clang/tools/libclang/CIndexInclusionStack.cpp +++ b/clang/tools/libclang/CIndexInclusionStack.cpp @@ -40,10 +40,10 @@ void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB, i = 0; for ( ; i < n ; ++i) { - - const SrcMgr::SLocEntry &SL = SM.getSLocEntry(i); + bool Invalid = false; + const SrcMgr::SLocEntry &SL = SM.getSLocEntry(i, &Invalid); - if (!SL.isFile()) + if (!SL.isFile() || Invalid) continue; const SrcMgr::FileInfo &FI = SL.getFile(); |