aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-01-11 02:13:09 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-01-11 02:13:09 +0000
commitc37ab63df71e425951ce7a8c797540a18d0a3e63 (patch)
treef6b931384312ef57953ffe3cf31f449970b01bdd
parent12591d70f6c98a5c9989df2afb88e8590fc77bfa (diff)
Allow parameter attributes on varargs function parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45850 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Verifier.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 0f7852d411..8b300ff07f 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -390,10 +390,9 @@ void Verifier::VerifyParamAttrs(const FunctionType *FT,
if (!Attrs)
return;
- // Note that when calling a varargs function, the following test disallows
- // parameter attributes for the arguments corresponding to the varargs part.
- Assert1(Attrs->size() &&
- Attrs->getParamIndex(Attrs->size()-1) <= FT->getNumParams(),
+ Assert1(FT->isVarArg() ||
+ (Attrs->size() &&
+ Attrs->getParamIndex(Attrs->size()-1) <= FT->getNumParams()),
"Attributes after end of type!", V);
bool SawNest = false;