[all-commits] [llvm/llvm-project] 9b7139: [analyzer] Avoid a crash in a debug printout funct...

NagyDonat via All-commits all-commits at lists.llvm.org
Thu Jan 25 08:03:22 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b71393569ae4508d78b8a21993c21530bfdccc5
      https://github.com/llvm/llvm-project/commit/9b71393569ae4508d78b8a21993c21530bfdccc5
  Author: NagyDonat <donat.nagy at ericsson.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp

  Log Message:
  -----------
  [analyzer] Avoid a crash in a debug printout function (#79446)

Previously the function `RangeConstraintManager::printValue()` crashed
when it encountered an empty rangeset (because `RangeSet::getBitwidth()`
and `RangeSet::isUnsigned()` assert that the rangeset is not empty).
This commit adds a special case that avoids this behavior.

As `printValue()` is only used by the checker debug.ExprInspection (and
during manual debugging), the impacts of this commit are very limited.

---------

Co-authored-by: Balazs Benics <benicsbalazs at gmail.com>




More information about the All-commits mailing list