Fix possible null dereference by bailing out of CheckObjCPropertyAttributes() early if the Decl* is null.
llvm-svn: 100483
This commit is contained in:
parent
b7a20ee5b5
commit
b535782fc4
|
@ -984,7 +984,10 @@ void Sema::CheckObjCPropertyAttributes(DeclPtrTy PropertyPtrTy,
|
|||
unsigned &Attributes) {
|
||||
// FIXME: Improve the reported location.
|
||||
Decl *PDecl = PropertyPtrTy.getAs<Decl>();
|
||||
ObjCPropertyDecl *PropertyDecl = dyn_cast_or_null<ObjCPropertyDecl>(PDecl);
|
||||
if (!PDecl)
|
||||
return;
|
||||
|
||||
ObjCPropertyDecl *PropertyDecl = cast<ObjCPropertyDecl>(PDecl);
|
||||
QualType PropertyTy = PropertyDecl->getType();
|
||||
|
||||
// readonly and readwrite/assign/retain/copy conflict.
|
||||
|
|
Loading…
Reference in New Issue