Commit a455ff1
committed
[region-isolation] Be more aggressive about not looking through Sendable values when getting underlying objects.
Otherwise, in cases like the following, we look through the load to x.boolean
and think that the closure is actually capturing x instead of y:
```swift
func testBooleanCapture(_ x: inout NonSendableKlass) {
let y = x.boolean
Task.detached { @mainactor [z = y] in
print(z)
}
}
```
rdar://131369987
(cherry picked from commit c06d872)1 parent c8aee3c commit a455ff1
File tree
4 files changed
+24
-5
lines changed- lib/SILOptimizer
- Analysis
- Utils
- test/Concurrency
4 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
| |||
385 | 390 | | |
386 | 391 | | |
387 | 392 | | |
| 393 | + | |
388 | 394 | | |
389 | 395 | | |
390 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
1133 | | - | |
| 1133 | + | |
| 1134 | + | |
1134 | 1135 | | |
1135 | | - | |
| 1136 | + | |
| 1137 | + | |
1136 | 1138 | | |
1137 | 1139 | | |
1138 | 1140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
1331 | 1332 | | |
1332 | 1333 | | |
1333 | 1334 | | |
1334 | | - | |
| 1335 | + | |
1335 | 1336 | | |
1336 | | - | |
| 1337 | + | |
1337 | 1338 | | |
1338 | 1339 | | |
1339 | 1340 | | |
| |||
1813 | 1814 | | |
1814 | 1815 | | |
1815 | 1816 | | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
0 commit comments