diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-09-12 01:10:36 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-09-12 01:10:36 +0000 |
commit | 8644aa9149f40fb00bfd20f0a22a873428f520d3 (patch) | |
tree | 68e2b6dc4e3fbaf3f3e62e08915ee11f9baf4a91 /tools | |
parent | e825cf3ff84c3d47c73ddd39fb66617567093981 (diff) | |
download | clang-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.cpp | 2 |
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); |