Skip to content

Commit 01c9fe4

Browse files
committed
When assigning into memory via builtin assign, be sure that we store a +1 value.
NOTE: 1. This can not happen today with the +1 runtime. 2. This is tested by an updated builtins.swift test for +0 that I am going to commit in a little bit. 3. We immediately forward the value when we put it into memory. rdar://34222540
1 parent 23ab6ab commit 01c9fe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILGen/SILGenBuiltin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static ManagedValue emitBuiltinAssign(SILGenFunction &SGF,
268268
// Build the value to be assigned, reconstructing tuples if needed.
269269
auto src = RValue(SGF, args.slice(0, args.size() - 1), assignFormalType);
270270

271-
std::move(src).assignInto(SGF, loc, addr);
271+
std::move(src).ensurePlusOne(SGF, loc).assignInto(SGF, loc, addr);
272272

273273
return ManagedValue::forUnmanaged(SGF.emitEmptyTuple(loc));
274274
}

0 commit comments

Comments
 (0)