From 9c00be5527d83dd9dc2073652ffe6ded8f408402 Mon Sep 17 00:00:00 2001 From: Charles Davis Date: Wed, 10 Feb 2010 23:26:12 +0000 Subject: [PATCH] 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 --- lib/Sema/TargetAttributesSema.cpp | 4 ++-- 1 file 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(D); - if(VD->getType()->isFunctionPointerType()) + if (VD && VD->getType()->isFunctionPointerType()) return; // Attribute can only be applied to function types. - if(!isa(D)) { + if (!isa(D)) { S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) << Attr.getName() << /* function */0; return; -- 2.50.1