aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-30 19:45:53 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-30 19:45:53 +0000
commit42748ec5cb2d75fe0dbb3a6db5aee6c11b5dc190 (patch)
tree56ec8838495a3667c3b43bcb0c7108d1d70e4b2e
parent106d9ea61c7211b370c5b97a0288652c23da329a (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.cpp4
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(