Author: Shafik Yaghmour Date: 2025-05-02T07:27:50-07:00 New Revision: 65438787c7729d84964a25c2db5f7996dd1343cc
URL: https://github.com/llvm/llvm-project/commit/65438787c7729d84964a25c2db5f7996dd1343cc DIFF: https://github.com/llvm/llvm-project/commit/65438787c7729d84964a25c2db5f7996dd1343cc.diff LOG: [Clang][NFC] assert IFaceT in SemaObjC::HandleExprPropertyRefExpr (#138026) Static analysis flagged that we use IFaceT in HandleExprPropertyRefExpr without checking even though getInterfaceType() can return nullptr. The comments make it clear the assumption is that we will always have an interface, so we will document this via an assert. Fixes: https://github.com/llvm/llvm-project/issues/134954 Added: Modified: clang/lib/Sema/SemaExprObjC.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index abed95d3eacfc..b248ea380a526 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1980,6 +1980,7 @@ ExprResult SemaObjC::HandleExprPropertyRefExpr( SourceLocation SuperLoc, QualType SuperType, bool Super) { ASTContext &Context = getASTContext(); const ObjCInterfaceType *IFaceT = OPT->getInterfaceType(); + assert(IFaceT && "Expected an Interface"); ObjCInterfaceDecl *IFace = IFaceT->getDecl(); if (!MemberName.isIdentifier()) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits