From: Argyrios Kyrtzidis Date: Thu, 12 Sep 2013 01:10:36 +0000 (+0000) Subject: [libclang] In clang_getLocation, check that the provided line/column is valid. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8644aa9149f40fb00bfd20f0a22a873428f520d3;p=clang [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 --- 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);