[PATCH] D64374: [analyzer] CastValueChecker: Model casts

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 15:16:20 PDT 2019


NoQ added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:58
+static std::string getCastName(const Expr *Cast) {
+  return Cast->getType()->getPointeeCXXRecordDecl()->getNameAsString();
+}
----------------
You should still check if `Cast->getType()->getPointeeCXXRecordDecl()` returns null, otherwise you can crash.

But when it's null, you should immediately return `false` from your `evalCall`.


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

https://reviews.llvm.org/D64374





More information about the cfe-commits mailing list