[PATCH] D127285: [analyzer] Fix assertion failure after getKnwonValue call

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 03:16:27 PDT 2022


martong created this revision.
martong added a reviewer: steakhal.
Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun.
Herald added a reviewer: Szelethus.
Herald added a project: All.
martong requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Depends on D126560 <https://reviews.llvm.org/D126560>. `getKnwonValue` has been changed by the parent patch
in a way that simplification was removed. This is not correct when the
function is called by the Checkers. Thus, a new internal function is
introduced `getConstValue` which simply queries the constraint manager.
This `getConstValue` is used internally in the SimpleSValBuilder when a
binop is evaluated, this way we avoid the recursion into the `Simplifier`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127285

Files:
  clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
  clang/test/Analysis/svalbuilder-simplify-no-crash.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127285.435092.patch
Type: text/x-patch
Size: 5095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220608/87783813/attachment.bin>


More information about the cfe-commits mailing list