summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TargetAttributesSema.cpp
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2010-02-10 23:26:12 +0000
committerCharles Davis <cdavis@mines.edu>2010-02-10 23:26:12 +0000
commit42b384242978f914327b1a9a5e6894684eb3026b (patch)
tree2b49b9e2444d7b2725ac3289a2a9e9640e1f9f22 /clang/lib/Sema/TargetAttributesSema.cpp
parentbbc0aa516623f73d606783a2e4594c50fed4a830 (diff)
downloadbcm5719-llvm-42b384242978f914327b1a9a5e6894684eb3026b.tar.gz
bcm5719-llvm-42b384242978f914327b1a9a5e6894684eb3026b.zip
Fix a potential null-pointer use, and fix the style of my new function.
Thanks, Anton! llvm-svn: 95821
Diffstat (limited to 'clang/lib/Sema/TargetAttributesSema.cpp')
-rw-r--r--clang/lib/Sema/TargetAttributesSema.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp
index ab54949c995..9062d368cad 100644
--- a/clang/lib/Sema/TargetAttributesSema.cpp
+++ b/clang/lib/Sema/TargetAttributesSema.cpp
@@ -83,10 +83,10 @@ static void HandleX86ForceAlignArgPointerAttr(Decl *D,
// 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;
OpenPOWER on IntegriCloud