Commit 27a8852
committed
MoveOnlyAddressChecker: More robust checking for consume-during-borrow.
- While an opaque borrow access occurs to part of a value, the entire scope of
the access needs to be treated as a liveness range, so add the `EndAccess`es
to the liveness range.
- The SIL verifier may crash the compiler on SILGen-generated code when the
developer's source contains consume-during-borrow code patterns. Allow
`load_borrow` instructions to be marked `[unchecked]`, which suppresses
verifier checks until the move checker runs and gets a chance to properly
diagnose these errors.
Fixes rdar://124360175.1 parent b7b93a1 commit 27a8852
File tree
13 files changed
+153
-28
lines changed- include/swift/SIL
- lib
- SILGen
- SILOptimizer/Mandatory
- SIL
- IR
- Parser
- Verifier
- Serialization
- test
- SILGen
- SILOptimizer
13 files changed
+153
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4591 | 4591 | | |
4592 | 4592 | | |
4593 | 4593 | | |
4594 | | - | |
| 4594 | + | |
| 4595 | + | |
4595 | 4596 | | |
4596 | 4597 | | |
| 4598 | + | |
| 4599 | + | |
4597 | 4600 | | |
4598 | 4601 | | |
4599 | 4602 | | |
4600 | 4603 | | |
4601 | 4604 | | |
| 4605 | + | |
| 4606 | + | |
| 4607 | + | |
| 4608 | + | |
| 4609 | + | |
| 4610 | + | |
| 4611 | + | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
4602 | 4617 | | |
4603 | 4618 | | |
4604 | 4619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1733 | 1733 | | |
1734 | 1734 | | |
1735 | 1735 | | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
1736 | 1739 | | |
1737 | 1740 | | |
1738 | 1741 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3733 | 3733 | | |
3734 | 3734 | | |
3735 | 3735 | | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
3736 | 3750 | | |
3737 | 3751 | | |
3738 | 3752 | | |
3739 | 3753 | | |
3740 | 3754 | | |
3741 | | - | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
3742 | 3758 | | |
3743 | 3759 | | |
3744 | 3760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
791 | | - | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
792 | 794 | | |
793 | 795 | | |
794 | 796 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2623 | 2623 | | |
2624 | 2624 | | |
2625 | 2625 | | |
2626 | | - | |
2627 | | - | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
2628 | 2633 | | |
2629 | 2634 | | |
2630 | 2635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1231 | 1231 | | |
1232 | 1232 | | |
1233 | 1233 | | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1234 | 1239 | | |
1235 | 1240 | | |
1236 | 1241 | | |
| |||
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1261 | 1268 | | |
1262 | 1269 | | |
1263 | 1270 | | |
1264 | 1271 | | |
1265 | 1272 | | |
1266 | 1273 | | |
1267 | 1274 | | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
| 1275 | + | |
1272 | 1276 | | |
1273 | 1277 | | |
1274 | 1278 | | |
1275 | 1279 | | |
1276 | 1280 | | |
1277 | 1281 | | |
| 1282 | + | |
| 1283 | + | |
1278 | 1284 | | |
1279 | 1285 | | |
1280 | 1286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
217 | 233 | | |
218 | 234 | | |
219 | 235 | | |
| |||
228 | 244 | | |
229 | 245 | | |
230 | 246 | | |
231 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
232 | 250 | | |
| 251 | + | |
233 | 252 | | |
234 | 253 | | |
235 | 254 | | |
| |||
252 | 271 | | |
253 | 272 | | |
254 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
255 | 279 | | |
256 | 280 | | |
257 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2260 | 2260 | | |
2261 | 2261 | | |
2262 | 2262 | | |
2263 | | - | |
2264 | 2263 | | |
2265 | 2264 | | |
2266 | 2265 | | |
| |||
2271 | 2270 | | |
2272 | 2271 | | |
2273 | 2272 | | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
2274 | 2284 | | |
2275 | 2285 | | |
2276 | 2286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1601 | 1601 | | |
1602 | 1602 | | |
1603 | 1603 | | |
| 1604 | + | |
| 1605 | + | |
1604 | 1606 | | |
1605 | 1607 | | |
1606 | 1608 | | |
| |||
0 commit comments