Manna created this revision. Manna added a reviewer: erichkeane. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware. Herald added a reviewer: NoQ. Herald added a project: All. Manna requested review of this revision. Herald added a project: clang.
This patch uses castAs instead of getAs which will assert if the type doesn't match in findMethodDecl(clang::ObjCMessageExpr const *, clang::ObjCObjectPointerType const *, clang::ASTContext &). Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D152194 Files: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp Index: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp +++ clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp @@ -743,7 +743,7 @@ QualType ReceiverType = MessageExpr->getReceiverType(); const auto *ReceiverObjectPtrType = - ReceiverType->getAs<ObjCObjectPointerType>(); + ReceiverType->castAs<ObjCObjectPointerType>(); // Do this "devirtualization" on instance and class methods only. Trust the // static type on super and super class calls.
Index: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp +++ clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp @@ -743,7 +743,7 @@ QualType ReceiverType = MessageExpr->getReceiverType(); const auto *ReceiverObjectPtrType = - ReceiverType->getAs<ObjCObjectPointerType>(); + ReceiverType->castAs<ObjCObjectPointerType>(); // Do this "devirtualization" on instance and class methods only. Trust the // static type on super and super class calls.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits