[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
  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.

See the discourse post on CallDescriptions and std::ranges here.

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

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

More information about the All-commits mailing list