[all-commits] [llvm/llvm-project] 985e39: [analyzer] Fix assertion on casting SVal to NonLoc...

Balazs Benics via All-commits all-commits at lists.llvm.org
Mon Aug 28 03:03:16 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 985e399647d591d6130ba6fe08c5b5f6cb87d9f6
      https://github.com/llvm/llvm-project/commit/985e399647d591d6130ba6fe08c5b5f6cb87d9f6
  Author: Balazs Benics <benicsbalazs at gmail.com>
  Date:   2023-08-28 (Mon, 28 Aug 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/IteratorRangeChecker.cpp
    M clang/test/Analysis/iterator-range.cpp

  Log Message:
  -----------
  [analyzer] Fix assertion on casting SVal to NonLoc inside the IteratorRange checker

The checker assumed that it could safely cast an SVal to Nonloc.
This surfaced because, with std::ranges, we can unintentionally match
on other APIs as well, thus increasing the likelihood of violating
checker assumptions about the context it's invoked.
https://godbolt.org/z/13vEb3K76

See the discourse post on CallDescriptions and std::ranges here.
https://discourse.llvm.org/t/calldescriptions-should-not-skip-the-ranges-part-in-std-names-when-matching/73076

Fixes https://github.com/llvm/llvm-project/issues/65009

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




More information about the All-commits mailing list