Skip to content

Commit 62e0703

Browse files
authored
Merge pull request swiftlang#15101 from gottesmm/pr-6f5ece3e041cab4576af08e3631c49dce88645ed
[+0-normal-args] Be sure if we are forwarding arguments into memory, …
2 parents b15d007 + d6a1015 commit 62e0703

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SILGen/ArgumentSource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void ArgumentSource::forwardInto(SILGenFunction &SGF, Initialization *dest) && {
236236
llvm_unreachable("cannot forward an l-value");
237237
case Kind::RValue: {
238238
auto loc = getKnownRValueLocation();
239-
std::move(*this).asKnownRValue(SGF).forwardInto(SGF, loc, dest);
239+
std::move(*this).asKnownRValue(SGF).ensurePlusOne(SGF, loc).forwardInto(SGF, loc, dest);
240240
return;
241241
}
242242
case Kind::Expr: {
@@ -248,7 +248,7 @@ void ArgumentSource::forwardInto(SILGenFunction &SGF, Initialization *dest) && {
248248
auto loc = getKnownTupleLocation();
249249
auto rvalue = std::move(*this).getKnownTupleAsRValue(SGF, SGFContext(dest));
250250
if (!rvalue.isInContext())
251-
std::move(rvalue).forwardInto(SGF, loc, dest);
251+
std::move(rvalue).ensurePlusOne(SGF, loc).forwardInto(SGF, loc, dest);
252252
return;
253253
}
254254
}

0 commit comments

Comments
 (0)