[PATCH] D127285: [analyzer] Fix assertion failure after getKnownValue call
Balázs Benics via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 8 07:32:53 PDT 2022
steakhal accepted this revision.
steakhal added inline comments.
This revision is now accepted and ready to land.
================
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);
----------------
martong wrote:
> 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.
> 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 know. My point is that the name of those two functions won't express the difference; thus I wanted to have a more verbose way of expressing that the private impl. fn. should not be exposed. I won't insist though.
> I've put it here because simplifySValOnce references this even in its header comment.
Well, it also refers to `simplifySValOnce()`, yet that's below that 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