<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 6, 2010, at 8:47 AM, Fariborz Jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><blockquote type="cite">Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp<br></blockquote><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=100496&r1=100495&r2=100496&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=100496&r1=100495&r2=100496&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)<br></blockquote><blockquote type="cite">+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Mon Apr  5 18:45:09 2010<br></blockquote><blockquote type="cite">@@ -160,7 +160,7 @@<br></blockquote><blockquote type="cite">                     PIDecl->getSetterName(),<br></blockquote><blockquote type="cite">                     DeclPtrTy::make(CCPrimary), isOverridingProperty,<br></blockquote><blockquote type="cite">                     MethodImplKind);<br></blockquote><blockquote type="cite">-      PIDecl = ProtocolPtrTy.getAs<ObjCPropertyDecl>();<br></blockquote><blockquote type="cite">+      PIDecl = cast<ObjCPropertyDecl>(ProtocolPtrTy.getAs<Decl>());<br></blockquote><br>Is this right? Here we assume that ProtocolPtrTy.getAs<Decl>() is never null (which may be the case).<br><br>- Fariborz<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">   }<br></blockquote><blockquote type="cite">   PIDecl->makeitReadWriteAttribute();</blockquote></span></blockquote></div><br><div>It's no worse than what it was before.  Notice the unconditional dereference of PIDecl afterwards.  That was there before, which is why I thought this had to be non-null.  If this could be null, we obviously need to add a null check and possibly bail out of the method.</div></body></html>