From: Duncan Sands Date: Fri, 30 Nov 2007 15:52:20 +0000 (+0000) Subject: Check that there are not more attributes than X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a8b974648f9d8bacc43280653dc654c9120d05ca;p=oota-llvm.git Check that there are not more attributes than function parameters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44452 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index eb7c90f01cc..c3633ff97a1 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -396,6 +396,10 @@ void Verifier::visitFunction(Function &F) { bool SawSRet = false; if (const ParamAttrsList *Attrs = F.getParamAttrs()) { + Assert1(Attrs->size() && + Attrs->getParamIndex(Attrs->size()-1) <= FT->getNumParams(), + "Function has excess attributes!", &F); + bool SawNest = false; for (unsigned Idx = 0; Idx <= FT->getNumParams(); ++Idx) {