[PATCH] D103317: [Analyzer][Core] Make SValBuilder to better simplify svals with 3 symbols in the tree

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 23 07:39:34 PST 2021


martong added inline comments.


================
Comment at: clang/test/Analysis/svalbuilder-simplify-compound-svals.cpp:32
+  clang_analyzer_eval(x + y * z == 0); // expected-warning{{TRUE}}
+  clang_analyzer_eval(y * z == 0);     // expected-warning{{TRUE}}
+  clang_analyzer_eval(x == 0);         // expected-warning{{TRUE}}
----------------
martong wrote:
> steakhal wrote:
> > You could additionally assert that `y == 0` and `z == 0`.
> `y * z == 0` does not imply that both `y` and `z` are `0`. However, we could expect that one of them is `0`, but currently we don't have such a deduction (this might be done in `ConstraintAssignor` in an independent patch).
> this might be done in ConstraintAssignor in an independent patch
Actually, it is not a good idea to bifurcate there (and architecturally impossible ATM), so we should implement that differently.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103317/new/

https://reviews.llvm.org/D103317



More information about the cfe-commits mailing list