[PATCH] D79232: [analyzer] Refactor range inference for symbolic expressions

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 3 14:20:58 PDT 2020


NoQ added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:340-345
+    // TODO #2: We didn't go into the nested expressions before, so it
+    // might cause us spending much more time doing the inference.
+    // This can be a problem for deeply nested expressions that are
+    // involved in conditions and get tested continuously.  We definitely
+    // need to address this issue and introduce some sort of caching
+    // in here.
----------------
vsavchenko wrote:
> NoQ wrote:
> > I think this is a must-have, at least in some form. We've been exploding like this before on real-world code, well, probably not with bitwise ops but i'm still worried.
> It will be pretty easy to introduce a limit on how deep we go into a tree of the given symbolic expression. That can also be a solution.
I mean, doing something super trivial, like defining a map from symexprs to ranges in `SymbolicRangeInferrer` itself and find-or-inserting into it, will probably not be harder than counting depth(?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79232





More information about the cfe-commits mailing list