[llvm-commits] [llvm] r44452 - /llvm/trunk/lib/VMCore/Verifier.cpp
Duncan Sands
baldrick at free.fr
Fri Nov 30 07:52:20 PST 2007
Author: baldrick
Date: Fri Nov 30 09:52:20 2007
New Revision: 44452
URL: http://llvm.org/viewvc/llvm-project?rev=44452&view=rev
Log:
Check that there are not more attributes than
function parameters.
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=44452&r1=44451&r2=44452&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Nov 30 09:52:20 2007
@@ -396,6 +396,10 @@
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) {
More information about the llvm-commits
mailing list