From 068acc549547bebefd40e1dffb505d1a4477572d Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Tue, 2 Jul 2013 03:28:10 +0000 Subject: [PATCH] IRVerifier: Correctly check attribute types Add missing parenthesis such that all and not only the very first attribute is checked. Testing this piece of code is not possible with an LLVM-IR test file, as the LLVM-IR parser has a similar check such that the wrong IR does not even arrive at the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185408 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Verifier.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index 7123eaf18a0..8b4c1655d8d 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -695,10 +695,11 @@ void Verifier::VerifyAttributeTypes(AttributeSet Attrs, unsigned Idx, I->getKindAsEnum() == Attribute::Builtin || I->getKindAsEnum() == Attribute::NoBuiltin || I->getKindAsEnum() == Attribute::Cold) { - if (!isFunction) + if (!isFunction) { CheckFailed("Attribute '" + I->getAsString() + "' only applies to functions!", V); return; + } } else if (isFunction) { CheckFailed("Attribute '" + I->getAsString() + "' does not apply to functions!", V); -- 2.11.0