File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1254,9 +1254,11 @@ RValue SILGenFunction::emitRValueForPropertyLoad(
1254
1254
(!C.isImmediatePlusZeroOk () &&
1255
1255
!(C.isGuaranteedPlusZeroOk () && isGuaranteedValid))) {
1256
1256
// If we have an abstraction change or if we have to produce a result at
1257
- // +1, then emit a RetainValue. If we know that our base will stay alive,
1258
- // we can emit at +0 for a guaranteed consumer. Otherwise, since we do not
1259
- // have enough information, we can only emit at +0 for immediate clients.
1257
+ // +1, then copy the value. If we know that our base will stay alive for
1258
+ // the entire usage of this value, we can borrow the value at +0 for a
1259
+ // guaranteed consumer. Otherwise, since we do not have enough information
1260
+ // to know if the base's lifetime last's as long as our use of the access,
1261
+ // we can only emit at +0 for immediate clients.
1260
1262
result = result.copyUnmanaged (*this , loc);
1261
1263
}
1262
1264
} else {
You can’t perform that action at this time.
0 commit comments