Commit 2b70d2d
committed
Fix SemanticARCOpts LoadCopyToBorrowOpt for ObjC closure thunk
This fixes a use-after-free miscompile.
LoadCopyToBorrowOpt alias analysis was wrong in
visitArgumentAccess. inout_aliasable does not give you exclusive
access to an address.
This resulted in removal of a retain before calling an ObjC block
after converting it from a Swift closure.
@_silgen_name("foreign")
func foreign(block: @escaping @convention(block) () -> Void)
public func doit(closure: @escaping () -> ()) {
foreign { [closure] in closure() }
}
Fixes rdar://1212680941 parent 0c4efe4 commit 2b70d2d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
0 commit comments