Skip to content

Commit 5eff528

Browse files
authored
Merge pull request #15131 from gottesmm/pr-f55b282e4fa6433d6c2d5d810e239930e4fa87b5
[silgen] When forwarding an rvalue into memory to pass as an argument…
2 parents 28d8ca4 + d0571e6 commit 5eff528

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/SILGen/ArgumentSource.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ ManagedValue ArgumentSource::getAsSingleValue(SILGenFunction &SGF,
174174
case Kind::RValue: {
175175
auto loc = getKnownRValueLocation();
176176
if (auto init = C.getEmitInto()) {
177-
std::move(*this).asKnownRValue(SGF).forwardInto(SGF, loc, init);
177+
std::move(*this).asKnownRValue(SGF)
178+
.ensurePlusOne(SGF, loc)
179+
.forwardInto(SGF, loc, init);
178180
return ManagedValue::forInContext();
179181
} else {
180182
return std::move(*this).asKnownRValue(SGF).getAsSingleValue(SGF, loc);

0 commit comments

Comments
 (0)