[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 9 08:21:08 PDT 2020


ASDenysPetrov added a comment.

@NoQ

> Can we collapse this function further towards this goal? Say, why not pump every region //unconditionally// through `castRegion()`? Does `dispatchCast()` use `castRegion()` internally - and if it does, why are there so many branches in this function?

Thank you for raising such a good questions :)
Honestly, I spent a week debugging to undersand what's going on in the Store, I never had a chance to dig into it before. It was tough. I'll proceed this to try to make what you mentioned.

The thing I'm sure that the type of retrieved value should be the same as the type of which this value was declared? In other words we can //unconditionally// cast all the values, can't we? Is there any case that contradicts me?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89055



More information about the cfe-commits mailing list