summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-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