diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -328,11 +328,10 @@ Value *CallBase::getReturnedArgOperand() const { unsigned Index; - if (Attrs.hasAttrSomewhere(Attribute::Returned, &Index) && Index) + if (Attrs.hasAttrSomewhere(Attribute::Returned, &Index)) return getArgOperand(Index - AttributeList::FirstArgIndex); if (const Function *F = getCalledFunction()) - if (F->getAttributes().hasAttrSomewhere(Attribute::Returned, &Index) && - Index) + if (F->getAttributes().hasAttrSomewhere(Attribute::Returned, &Index)) return getArgOperand(Index - AttributeList::FirstArgIndex); return nullptr;