[PATCH] D99181: [analyzer] Fix crash on spaceship operator (PR47511)

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 31 00:32:27 PDT 2021


steakhal accepted this revision.
steakhal added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp:331
 
       // Note: LAnd, LOr, Comma are handled specially by higher-level logic.
 
----------------
vsavchenko wrote:
> steakhal wrote:
> > So, there are some corner cases already.
> > I can't see any way of implementing this reasonably here, as you pointed out the return value of the function is not a good fit.
> > 
> > Shouldn't put your mock 'implementation' to a different place?
> > I'm just nitpicking though.
> `evalAPSInt` is called in a lot of different contexts, I don't know how else to ensure that it won't crash on `BO_Cmp` in all of those contexts.
I don't know. It doesn't feel like a strong argument. I still don't feel that this is the right direction.
The code already looks convoluted and unnecessarily complex, your change wouldn't worsen that too much.
Considering that it actually fixes something, eh, so be it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99181



More information about the cfe-commits mailing list