[cfe-commits] r100483 - /cfe/trunk/lib/Sema/SemaObjCProperty.cpp

Fariborz Jahanian fjahanian at apple.com
Tue Apr 6 08:44:05 PDT 2010


On Apr 5, 2010, at 3:39 PM, Ted Kremenek wrote:

> Author: kremenek
> Date: Mon Apr  5 17:39:42 2010
> New Revision: 100483
>
> URL: http://llvm.org/viewvc/llvm-project?rev=100483&view=rev
> Log:
> Fix possible null dereference by bailing out of  
> CheckObjCPropertyAttributes() early if the Decl* is null.
>
> Modified:
>    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=100483&r1=100482&r2=100483&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Mon Apr  5 17:39:42 2010
> @@ -984,7 +984,10 @@
>                                        unsigned &Attributes) {
>   // FIXME: Improve the reported location.
>   Decl *PDecl = PropertyPtrTy.getAs<Decl>();
> -  ObjCPropertyDecl *PropertyDecl =  
> dyn_cast_or_null<ObjCPropertyDecl>(PDecl);
> +  if (!PDecl)
> +    return;

Looks like you fixed it.

- Fariborz

>
> +
> +  ObjCPropertyDecl *PropertyDecl = cast<ObjCPropertyDecl>(PDecl);
>   QualType PropertyTy = PropertyDecl->getType();
>
>   // readonly and readwrite/assign/retain/copy conflict.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list