From: Evan Cheng Date: Fri, 11 Jan 2008 02:13:09 +0000 (+0000) Subject: Allow parameter attributes on varargs function parameters. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c37ab63df71e425951ce7a8c797540a18d0a3e63;p=oota-llvm.git Allow parameter attributes on varargs function parameters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45850 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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;