[all-commits] [llvm/llvm-project] fd569a: [libclang] Fix error handler in translateSourceLoc...

Simon Tatham via All-commits all-commits at lists.llvm.org
Fri Jun 18 05:43:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd569a11b585d13cdceac2d890c2beda0fa5f0eb
      https://github.com/llvm/llvm-project/commit/fd569a11b585d13cdceac2d890c2beda0fa5f0eb
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2021-06-18 (Fri, 18 Jun 2021)

  Changed paths:
    M clang/tools/libclang/CXSourceLocation.h

  Log Message:
  -----------
  [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




More information about the All-commits mailing list