Teach clang_getLocation() to cope with a NULL file argument.

llvm-svn: 102748
This commit is contained in:
Douglas Gregor 2010-04-30 19:45:53 +00:00
parent d6c5391cd9
commit 0925fbc3fd
1 changed files with 2 additions and 2 deletions

View File

@ -1296,9 +1296,9 @@ CXSourceLocation clang_getLocation(CXTranslationUnit tu,
CXFile file,
unsigned line,
unsigned column) {
if (!tu)
if (!tu || !file)
return clang_getNullLocation();
ASTUnit *CXXUnit = static_cast<ASTUnit *>(tu);
SourceLocation SLoc
= CXXUnit->getSourceManager().getLocation(