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

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 07:28:55 PDT 2022


martong added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:25-28
+  // Query the constraint manager whether the SVal has only one possible
+  // (integer) value. If that is the case, the value is returned. Otherwise,
+  // returns NULL.
+  const llvm::APSInt *getConstValue(ProgramStateRef state, SVal V);
----------------
steakhal wrote:
> I'm also wondering if this should be at the top. I would rather put it below `simplifySValOnce()`.
It is a good idea to draw the checker writer's attention to use `getKnownValue`, however, this is a `private` function deliberately for this exact reason.

> I'm also wondering if this should be at the top. I would rather put it below simplifySValOnce().
I've put it here because simplifySValOnce references this even in its header comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127285



More information about the cfe-commits mailing list