mirror of
https://github.com/apple/swift.git
synced 2026-10-14 15:51:20 +02:00
If there is a scoped lifetime dependence on an indirect argument, the
callee may escape the argument's address into the dependent value, e.g.
by using unsafe pointers. This is the case even if the dependence is not
addressable, e.g.
```
@_lifetime(&value)
init(single value: inout Element) {
self = unsafe MutableSpan(_unsafeStart: UnsafeMutablePointer(Builtin.addressof(&value)), count: 1)
}
```
So far, alias analysis assumed that such an address cannot escape, which
resulted in a mis-compile in redundant load elimination.
https://github.com/swiftlang/swift/issues/93141
rdar://189662383