[libclang] Fix error handler in translateSourceLocation.
authorSimon Tatham <simon.tatham@arm.com>
Fri, 18 Jun 2021 12:43:13 +0000 (13:43 +0100)
committerSimon Tatham <simon.tatham@arm.com>
Fri, 18 Jun 2021 12:43:14 +0000 (13:43 +0100)
commitfd569a11b585d13cdceac2d890c2beda0fa5f0eb
tree7059f5390230960f001776182c8f75d7688d1d78
parent8962c68ad007a525f9daa987c99eda57e0d0069a
[libclang] Fix error handler in translateSourceLocation.

Given an invalid SourceLocation, translateSourceLocation will call
clang_getNullLocation, and then do nothing with the result. But
clang_getNullLocation has no side effects: it just constructs and
returns a null CXSourceLocation value.

Surely the intention was to //return// that null CXSourceLocation to
the caller, instead of throwing it away and pressing on anyway.

Reviewed By: miyuki

Differential Revision: https://reviews.llvm.org/D104442
clang/tools/libclang/CXSourceLocation.h