You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SILGen: Fix potential use-after-free in @_backDeploy coroutines.
The SIL verifier has identified an issue with the SIL generated for property accessors structured like this:
```
public struct S {
@available(macOS, introduced: 12.0)
@_backDeploy(before: macOS 13.0)
public var x: String {
_read {
yield "x"
}
}
}
```
The emitted SIL is invalid because the value `%9` is used after `end_apply` may have ended the lifetime of the value:
```
bb1:
%8 = function_ref @$s4test1SV1xSSvrTwB : $@yield_once @convention(method) (S) -> @yields@guaranteed String9
(%9, %10) = begin_apply %8(%0) : $@yield_once @convention(method) (S) -> @yields@guaranteed String
end_apply %10
yield %9 : $String, resume bb3, unwind bb2
```
The fix is to move the `end_apply` to the resume and unwind blocks, after the value has been yielded to the caller.
Resolves rdar://96879247
0 commit comments