diff options
-rw-r--r-- | llvm/lib/VMCore/Function.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index 16728f6a0ca..37949559aaf 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -79,7 +79,7 @@ void Argument::setParent(Function *parent) { uint16_t ParamAttrsList::getParamAttrs(uint16_t Index) const { unsigned limit = attrs.size(); - for (unsigned i = 0; i < limit; ++i) + for (unsigned i = 0; i < limit && attrs[i].index <= Index; ++i) if (attrs[i].index == Index) return attrs[i].attrs; return ParamAttr::None; |