diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-30 19:45:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-30 19:45:53 +0000 |
commit | 42748ec5cb2d75fe0dbb3a6db5aee6c11b5dc190 (patch) | |
tree | 56ec8838495a3667c3b43bcb0c7108d1d70e4b2e | |
parent | 106d9ea61c7211b370c5b97a0288652c23da329a (diff) |
Teach clang_getLocation() to cope with a NULL file argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102748 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/CIndex/CIndex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 6221a615aa..f9f735113f 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -1296,9 +1296,9 @@ CXSourceLocation clang_getLocation(CXTranslationUnit tu, CXFile file, unsigned line, unsigned column) { - if (!tu) + if (!tu || !file) return clang_getNullLocation(); - + ASTUnit *CXXUnit = static_cast<ASTUnit *>(tu); SourceLocation SLoc = CXXUnit->getSourceManager().getLocation( |