aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/Function.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index e7a7041..ec34abc 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -107,7 +107,7 @@ bool Argument::hasNoAliasAttr() const {
/// it in its containing function.
bool Argument::hasStructRetAttr() const {
if (!isa<PointerType>(getType())) return false;
- if (getArgNo()) return false; // StructRet param must be first param
+ if (this != getParent()->arg_begin()) return false; // StructRet param must be first param
return getParent()->paramHasAttr(1, ParamAttr::StructRet);
}