Skip to content

Commit 842771c

Browse files
committed
[Distributed] destroy decoded arguments in reverse order
1 parent e22cf2e commit 842771c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/IRGen/GenDistributed.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,10 @@ void DistributedAccessor::emitReturn(llvm::Value *errorValue) {
591591
}
592592

593593
// Destroy loaded arguments.
594-
llvm::for_each(LoadedArguments, [&](const auto &argInfo) {
595-
emitDestroyCall(IGF, argInfo.second, argInfo.first);
596-
});
594+
for (auto argInfo = LoadedArguments.rbegin();
595+
argInfo != LoadedArguments.rend(); ++argInfo) {
596+
emitDestroyCall(IGF, argInfo->second, argInfo->first);
597+
}
597598

598599
Explosion voidResult;
599600

0 commit comments

Comments
 (0)