Skip to content

Commit 8c43428

Browse files
authored
Merge pull request #80118 from allevato/uninitialized-capture
[NFC] Fix a use of an uninitialized captured value.
2 parents 69e9dd3 + 8b483a6 commit 8c43428

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/SILGen/ResultPlan.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,11 +541,9 @@ class PackTransformResultPlan final : public ResultPlan {
541541
if (!eltTL.isAddressOnly()) {
542542
auto load = eltTL.emitLoad(SGF.B, loc, eltAddr,
543543
LoadOwnershipQualifier::Take);
544-
eltMV = SGF.emitManagedRValueWithCleanup(load, eltTL);
545-
} else {
546-
eltMV = SGF.emitManagedBufferWithCleanup(eltAddr, eltTL);
544+
return SGF.emitManagedRValueWithCleanup(load, eltTL);
547545
}
548-
return eltMV;
546+
return SGF.emitManagedBufferWithCleanup(eltAddr, eltTL);
549547
}();
550548

551549
// Finish in the normal way for scalar results.

0 commit comments

Comments
 (0)