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

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 8 15:36:03 PDT 2020


NoQ added a comment.

This actually looks correct to me but i suggest a bit more investigation. Architecturally, it doesn't make sense to me that `CastRetrievedVal()` does anything beyond `svalBuilder.dispatchCast(V, castTy)`. After all, there's only one way to cast a value from one type to another, and `svalBuilder.dispatchCast(V, castTy)` was supposed to be the ultimate method to do so.

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?


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