[PATCH] D77062: [analyzer] Improve zero assumption in CStringChecke::assumeZero
Balázs Benics via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 29 04:44:51 PDT 2020
steakhal added a comment.
In D77062#2298663 <https://reviews.llvm.org/D77062#2298663>, @ASDenysPetrov wrote:
> @steakhal
> You told that you suppose a potential fix. It would be nice, if you share the patch to review.
I mean, I already told you my suggestion, there was no concrete fix in my mind at the time.
In D77062#2298748 <https://reviews.llvm.org/D77062#2298748>, @NoQ wrote:
> Nice, very interesting!
>
> The contract of RegionStore with respect to type punning is that it stores the value //as written//, even if its type doesn't match the storage type, but then it casts the value to the correct type upon reading by invoking `CastRetrievedVal()` on it. That's where the fix should probably be.
Hm, thank you for the pointer.
I'm not sure if I fixed this in the right way - I'm still puzzled by the spaghetti code :D
Never the less, here is my proposed fix for this: D88477 <https://reviews.llvm.org/D88477>
---
@ASDenysPetrov Do you still want to rework the API of the `assumeZero`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77062/new/
https://reviews.llvm.org/D77062
More information about the cfe-commits
mailing list