aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Type.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-31 17:50:33 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-31 17:50:33 +0000
commit1fd79b8c42fcdde3b102febb893e6b3919266031 (patch)
treeac003b9cff7e700ad22dadf028383009a5ad7c73 /lib/VMCore/Type.cpp
parentf17a0b7117af9fed21bd2232d50d4fc4c27b5944 (diff)
downloadexternal_llvm-1fd79b8c42fcdde3b102febb893e6b3919266031.zip
external_llvm-1fd79b8c42fcdde3b102febb893e6b3919266031.tar.gz
external_llvm-1fd79b8c42fcdde3b102febb893e6b3919266031.tar.bz2
Fix a bug in getParamAttrs where an invalid value would be returned if the
index passed in was out of range for the number of parameter attributes set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r--lib/VMCore/Type.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 7c40cdc..e328369 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -1015,9 +1015,9 @@ FunctionType *FunctionType::get(const Type *ReturnType,
FunctionType::ParameterAttributes
FunctionType::getParamAttrs(unsigned Idx) const {
if (!ParamAttrs)
- return ParameterAttributes(0);
- if (Idx > ParamAttrs->size())
- return ParameterAttributes(0);
+ return NoAttributeSet;
+ if (Idx >= ParamAttrs->size())
+ return NoAttributeSet;
return (*ParamAttrs)[Idx];
}