[PATCH] D66325: [analyzer] CastValueChecker: Store the dynamic types and casts

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 19 15:13:35 PDT 2019


NoQ added a comment.

Yay! I understand the rough idea and it looks perfectly reasonable to start with. Please add FIXMEs/TODOs on how we eventually want to support more complicated inheritance hierarchies.



================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeMap.h:32
+/// A set of dynamic cast informations.
+REGISTER_SET_WITH_PROGRAMSTATE(DynamicCastSet, clang::ento::DynamicCastInfo)
 
----------------
Emm, so you're saving successes and failures of all casts //regardless of which object is getting casted//? That's definitely not sufficient. If `X` is a `Stmt` that isn't an `Expr`, you can't automatically infer that `Y` is a `Stmt` that isn't an `Expr` for any object `Y` other than `X` . This information needs to be per-object. Then you'll need to clean it up in `checkDeadSymbols`.


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

https://reviews.llvm.org/D66325





More information about the cfe-commits mailing list