Fix out of bounds access in hasStructRetAttr

llvm-svn: 254273
This commit is contained in:
Sanjoy Das 2015-11-29 23:15:43 +00:00
parent 9551a44d0c
commit 5e30bbe7ae
1 changed files with 6 additions and 0 deletions

View File

@ -1730,6 +1730,9 @@ public:
/// \brief Determine if the call returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
if (getNumArgOperands() == 0)
return false;
// Be friendly and also check the callee.
return paramHasAttr(1, Attribute::StructRet);
}
@ -3614,6 +3617,9 @@ public:
/// \brief Determine if the call returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
if (getNumArgOperands() == 0)
return false;
// Be friendly and also check the callee.
return paramHasAttr(1, Attribute::StructRet);
}