[cfe-commits] r95821 - /cfe/trunk/lib/Sema/TargetAttributesSema.cpp
Charles Davis
cdavis at mines.edu
Wed Feb 10 15:26:12 PST 2010
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;
More information about the cfe-commits
mailing list