aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;