[PATCH] D101041: [analyzer] Find better description for tracked symbolic values

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 07:42:27 PDT 2021


martong added a comment.

Awesome!



================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1529
+      //     b = a;
+      //     c = foo(b);
+      //
----------------
I'd rather use `identity` here (and at line 1509) instead of `foo`, I think that could make this explanation easier to follow.


================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1532
+      // Telling the user that the value of 'a' is assigned to 'c', while
+      // correct, can be confusing.
+      StoreManager::FindUniqueBinding FB(V.getAsLocSymbol());
----------------
So here, we have two or three bindings attached to `c`? `foo(b)` and `a` (and `b` as well) ?
What is the guarantee that `FindUniqueBinding` will return with the correct one `foo(b)`? Seems like we iterate through an ImmutableMap (AVL tree) with `MemRegion*` keys. And the order of the iteration depends on pointer values. What I want to express, is that I don't see how do we find the correct binding, seems like we just find one, which might be the one we look for if we are lucky.

Perhaps we could have a lit test for this example?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101041



More information about the cfe-commits mailing list