aboutsummaryrefslogtreecommitdiff
path: root/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
commit9c00be5527d83dd9dc2073652ffe6ded8f408402 (patch)
tree9b398405fad7b593747c71fddc9237f04a50aed8 /lib/Sema/TargetAttributesSema.cpp
parent5a0164d6ab843ca61437ec59a504365cb1c98f43 (diff)
Fix a potential null-pointer use, and fix the style of my new function.
Thanks, Anton! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95821 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/TargetAttributesSema.cpp')
-rw-r--r--lib/Sema/TargetAttributesSema.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/TargetAttributesSema.cpp b/lib/Sema/TargetAttributesSema.cpp
index ab54949c99..9062d368ca 100644
--- a/lib/Sema/TargetAttributesSema.cpp
+++ b/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;