Skip to content

Commit 414a48a

Browse files
shafikgithub-actions[bot]
authored andcommitted
Automerge: [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: llvm/llvm-project#134954
2 parents e3c8c4a + 6543878 commit 414a48a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Sema/SemaExprObjC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,7 @@ ExprResult SemaObjC::HandleExprPropertyRefExpr(
19801980
SourceLocation SuperLoc, QualType SuperType, bool Super) {
19811981
ASTContext &Context = getASTContext();
19821982
const ObjCInterfaceType *IFaceT = OPT->getInterfaceType();
1983+
assert(IFaceT && "Expected an Interface");
19831984
ObjCInterfaceDecl *IFace = IFaceT->getDecl();
19841985

19851986
if (!MemberName.isIdentifier()) {

0 commit comments

Comments
 (0)