Skip to content

Commit bd83509

Browse files
committed
[+0-normal-args] Enforce assigning to RValues to only occur with +1 RValues.
We already enforce in the same constraint RValue::forwardInto(...). rdar://34222540
1 parent d6b4fab commit bd83509

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/SILGen/RValue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ static void assignRecursive(SILGenFunction &SGF, SILLocation loc,
570570
void RValue::assignInto(SILGenFunction &SGF, SILLocation loc,
571571
SILValue destAddr) && {
572572
assert(isComplete() && "rvalue is not complete");
573+
assert(isPlusOne(SGF) && "Can not assign borrowed RValues");
573574
ArrayRef<ManagedValue> srcValues = values;
574575
assignRecursive(SGF, loc, type, srcValues, destAddr);
575576
assert(srcValues.empty() && "didn't claim all elements!");

0 commit comments

Comments
 (0)