[cfe-commits] r105392 - /cfe/trunk/tools/libclang/CIndex.cpp
Ted Kremenek
kremenek at apple.com
Thu Jun 3 08:52:32 PDT 2010
Author: kremenek
Date: Thu Jun 3 10:52:32 2010
New Revision: 105392
URL: http://llvm.org/viewvc/llvm-project?rev=105392&view=rev
Log:
Return a proper null CXSourceLocation from clang_getLocation() when the SourceLocation is invalid. Fixes <rdar://problem/8056640>.
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=105392&r1=105391&r2=105392&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Jun 3 10:52:32 2010
@@ -1416,7 +1416,9 @@
static_cast<const FileEntry *>(file),
line, column);
- return cxloc::translateSourceLocation(CXXUnit->getASTContext(), SLoc);
+ return SLoc.isInvalid() ?
+ clang_getNullLocation() :
+ cxloc::translateSourceLocation(CXXUnit->getASTContext(), SLoc);
}
CXSourceRange clang_getNullRange() {
More information about the cfe-commits
mailing list