Check that there are not more attributes than

function parameters.

llvm-svn: 44452
This commit is contained in:
Duncan Sands 2007-11-30 15:52:20 +00:00
parent 0112f62bb9
commit 4e8c071612
1 changed files with 4 additions and 0 deletions

View File

@ -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) {