Skip to content

Commit 2564b9d

Browse files
shafikGeorgeARM
authored andcommitted
[Clang][NFC] assert IFaceT in SemaObjC::HandleExprPropertyRefExpr (llvm#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#134954
1 parent aea449b commit 2564b9d

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)