Commit 8518c71
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 b4a169e commit 8518c71
File tree
13 files changed
+154
-29
lines changed- include/swift/SIL
- lib
- SILGen
- SILOptimizer/Mandatory
- SIL
- IR
- Parser
- Verifier
- Serialization
- test
- SILGen
- SILOptimizer
13 files changed
+154
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4588 | 4588 | | |
4589 | 4589 | | |
4590 | 4590 | | |
4591 | | - | |
| 4591 | + | |
| 4592 | + | |
4592 | 4593 | | |
4593 | 4594 | | |
| 4595 | + | |
| 4596 | + | |
4594 | 4597 | | |
4595 | 4598 | | |
4596 | 4599 | | |
4597 | 4600 | | |
4598 | 4601 | | |
| 4602 | + | |
| 4603 | + | |
| 4604 | + | |
| 4605 | + | |
| 4606 | + | |
| 4607 | + | |
| 4608 | + | |
| 4609 | + | |
| 4610 | + | |
| 4611 | + | |
| 4612 | + | |
| 4613 | + | |
4599 | 4614 | | |
4600 | 4615 | | |
4601 | 4616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1738 | 1738 | | |
1739 | 1739 | | |
1740 | 1740 | | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
1741 | 1744 | | |
1742 | 1745 | | |
1743 | 1746 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3727 | 3727 | | |
3728 | 3728 | | |
3729 | 3729 | | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
3730 | 3744 | | |
3731 | 3745 | | |
3732 | 3746 | | |
3733 | 3747 | | |
3734 | 3748 | | |
3735 | | - | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
3736 | 3752 | | |
3737 | 3753 | | |
3738 | 3754 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | | - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
785 | 787 | | |
786 | 788 | | |
787 | 789 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2626 | 2626 | | |
2627 | 2627 | | |
2628 | 2628 | | |
2629 | | - | |
2630 | | - | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
2631 | 2636 | | |
2632 | 2637 | | |
2633 | 2638 | | |
| |||
| 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: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1260 | 1267 | | |
1261 | 1268 | | |
1262 | 1269 | | |
1263 | 1270 | | |
1264 | 1271 | | |
1265 | 1272 | | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
| 1273 | + | |
| 1274 | + | |
1271 | 1275 | | |
1272 | 1276 | | |
1273 | 1277 | | |
1274 | 1278 | | |
1275 | 1279 | | |
1276 | 1280 | | |
| 1281 | + | |
| 1282 | + | |
1277 | 1283 | | |
1278 | 1284 | | |
1279 | 1285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
206 | 222 | | |
207 | 223 | | |
208 | 224 | | |
| |||
217 | 233 | | |
218 | 234 | | |
219 | 235 | | |
220 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
221 | 239 | | |
| 240 | + | |
222 | 241 | | |
223 | 242 | | |
224 | 243 | | |
| |||
241 | 260 | | |
242 | 261 | | |
243 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
244 | 268 | | |
245 | 269 | | |
246 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2257 | 2257 | | |
2258 | 2258 | | |
2259 | 2259 | | |
2260 | | - | |
2261 | 2260 | | |
2262 | 2261 | | |
2263 | 2262 | | |
| |||
2269 | 2268 | | |
2270 | 2269 | | |
2271 | 2270 | | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
2272 | 2282 | | |
2273 | 2283 | | |
2274 | 2284 | | |
| |||
| 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