diff options
| author | Duncan Sands <baldrick@free.fr> | 2007-11-30 15:52:20 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2007-11-30 15:52:20 +0000 |
| commit | 4e8c0716125e18b5630e895c8c47bf10b7e38511 (patch) | |
| tree | a843f211a91eef7da889429b4741ba78076c579b /llvm/lib/VMCore/Verifier.cpp | |
| parent | 0112f62bb96694b1db11cfd71bc03469332f8c37 (diff) | |
| download | bcm5719-llvm-4e8c0716125e18b5630e895c8c47bf10b7e38511.tar.gz bcm5719-llvm-4e8c0716125e18b5630e895c8c47bf10b7e38511.zip | |
Check that there are not more attributes than
function parameters.
llvm-svn: 44452
Diffstat (limited to 'llvm/lib/VMCore/Verifier.cpp')
| -rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index eb7c90f01cc..c3633ff97a1 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/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) { |

