From 8644aa9149f40fb00bfd20f0a22a873428f520d3 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 12 Sep 2013 01:10:36 +0000 Subject: [PATCH] [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 --- tools/libclang/CXSourceLocation.cpp | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.50.1