From 63753b7be7a66f46c61f2b0d2c9888ec2bf5e555 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 11 Jan 2008 02:13:09 +0000 Subject: [PATCH] Allow parameter attributes on varargs function parameters. llvm-svn: 45850 --- lib/VMCore/Verifier.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 0f7852d411e..8b300ff07f9 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;