[all-commits] [llvm/llvm-project] f8514f: Fix assertion failure "PathDiagnosticSpotPiece's m...

Arseniy Zaostrovnykh via All-commits all-commits at lists.llvm.org
Fri Mar 3 23:59:43 PST 2023


  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: f8514f04eef7c819f955746b0e6534798dfab741
      https://github.com/llvm/llvm-project/commit/f8514f04eef7c819f955746b0e6534798dfab741
  Author: Arseniy Zaostrovnykh <arseniy.zaostrovnykh at sonarsource.com>
  Date:   2023-03-03 (Fri, 03 Mar 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp
    M clang/test/Analysis/return-ptr-range.cpp

  Log Message:
  -----------
  Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions

Builtin functions (such as `std::move`, `std::forward`, `std::as_const`)
have a body generated during the analysis not related to any source file
so their statements have no valid source locations.
`ReturnPtrRange` checker should not report issues for these builtin
functions because they only forward its parameter and do not create any
new pointers.

Fixes #55347

Patch by Arseniy Zaostrovnykh.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D138713

(cherry picked from commit 98d55095d85129c2776a9d7a227c5f88e3ce2e01)




More information about the All-commits mailing list