Skip to content

Commit c901f97

Browse files
committed
Update visitRecursivelyLifetimeEndingUses for users with multiple results
1 parent afdd141 commit c901f97

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/SIL/IR/SILInstruction.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,7 @@ static bool visitRecursivelyLifetimeEndingUses(
18251825
// separately checked in the verifier. It is the only check that verifies
18261826
// the structural requirements of on-stack partial_apply uses.
18271827
auto *user = use->getUser();
1828-
if (user->getNumResults() != 1) {
1828+
if (user->getNumResults() == 0) {
18291829
llvm::errs() << "partial_apply [on_stack] use:\n";
18301830
user->printInContext(llvm::errs());
18311831
if (isa<BranchInst>(user)) {
@@ -1834,9 +1834,10 @@ static bool visitRecursivelyLifetimeEndingUses(
18341834
llvm::report_fatal_error("partial_apply [on_stack] must be directly "
18351835
"forwarded to a destroy_value");
18361836
}
1837-
if (!visitRecursivelyLifetimeEndingUses(use->getUser()->getResult(0),
1838-
noUsers, func)) {
1839-
return false;
1837+
for (auto res : use->getUser()->getResults()) {
1838+
if (!visitRecursivelyLifetimeEndingUses(res, noUsers, func)) {
1839+
return false;
1840+
}
18401841
}
18411842
}
18421843
return true;

0 commit comments

Comments
 (0)