erichkeane added inline comments.
================ Comment at: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:756 if (ReceiverType->isObjCIdType() || ReceiverType->isObjCClassType() || ASTCtxt.canAssignObjCInterfaces(ReceiverObjectPtrType, TrackedType)) { const ObjCInterfaceDecl *InterfaceDecl = TrackedType->getInterfaceDecl(); ---------------- erichkeane wrote: > Manna wrote: > > We are assigning: ReceiverObjectPtrType = nullptr return value from getAs. > > ``` > > const auto *ReceiverObjectPtrType = > > ReceiverType->getAs<ObjCObjectPointerType>(); > > ``` > > > > Then we are dereferencing nullptr ReceiverObjectPtrType when calling > > canAssignObjCInterfaces() > This isn't NFC, as `ReceiverObjectPtrType` is only used here. If the > `MessageExpr` `ReceiverKind` is not `Instance` or `Class`, we never > dereference this. So the declaration should be in this branch. Oh, and ALSO, we don't dereference it if `ReceiverType` is `ObjCIdType` or `ObhjCClassType`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152194/new/ https://reviews.llvm.org/D152194 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits