aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-09-12 01:10:36 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-09-12 01:10:36 +0000
commit8644aa9149f40fb00bfd20f0a22a873428f520d3 (patch)
tree68e2b6dc4e3fbaf3f3e62e08915ee11f9baf4a91 /tools
parente825cf3ff84c3d47c73ddd39fb66617567093981 (diff)
downloadclang-8644aa9149f40fb00bfd20f0a22a873428f520d3.tar.gz
[libclang] In clang_getLocation, check that the provided line/column is valid.
rdar://14971432 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/CXSourceLocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/libclang/CXSourceLocation.cpp b/tools/libclang/CXSourceLocation.cpp
index 64b2908c49..73711772fc 100644
--- a/tools/libclang/CXSourceLocation.cpp
+++ b/tools/libclang/CXSourceLocation.cpp
@@ -124,6 +124,8 @@ CXSourceLocation clang_getLocation(CXTranslationUnit TU,
unsigned column) {
if (!TU || !file)
return clang_getNullLocation();
+ if (line == 0 || column == 0)
+ return clang_getNullLocation();
LogRef Log = Logger::make(LLVM_FUNCTION_NAME);
ASTUnit *CXXUnit = cxtu::getASTUnit(TU);