Author: cdavis
Date: Wed Feb 10 17:26:12 2010
New Revision: 95821

URL: http://llvm.org/viewvc/llvm-project?rev=95821&view=rev
Log:
Fix a potential null-pointer use, and fix the style of my new function.
Thanks, Anton!

Modified:
    cfe/trunk/lib/Sema/TargetAttributesSema.cpp

Modified: cfe/trunk/lib/Sema/TargetAttributesSema.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TargetAttributesSema.cpp?rev=95821&r1=95820&r2=95821&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/TargetAttributesSema.cpp (original)
+++ cfe/trunk/lib/Sema/TargetAttributesSema.cpp Wed Feb 10 17:26:12 2010
@@ -83,10 +83,10 @@
   // do anything, either. It doesn't matter anyway, because there's nothing
   // special about calling a force_align_arg_pointer function.
   ValueDecl* VD = dyn_cast<ValueDecl>(D);
-  if(VD->getType()->isFunctionPointerType())
+  if (VD && VD->getType()->isFunctionPointerType())
     return;
   // Attribute can only be applied to function types.
-  if(!isa<FunctionDecl>(D)) {
+  if (!isa<FunctionDecl>(D)) {
     S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
       << Attr.getName() << /* function */0;
     return;


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to