Commit e4d1123
committed
Fix SILGen of borrow accessors returning guaranteed values from within a local borrow
Borrow accessor result can sometimes be generated from a local borrow and
returning the result produced within the local borrow scope will cause ownership errors.
We have to introduce new SIL semantics to make this possible.
Until then use a pair of unchecked_ownership_conversion instructions to silence the ownership errors.
We encounter this when we have:
Address-only self and @guaranteed result
Loadable self and @guaranteed result derived from an unsafe pointer stored property
This change also updates the result convention of borrow accessors with loadable result types
and indirect self argument type.1 parent 19ab4cc commit e4d1123
File tree
8 files changed
+556
-38
lines changed- lib
- SILGen
- SIL/IR
- test
- IRGen
- SILGen
8 files changed
+556
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | | - | |
1391 | 1390 | | |
1392 | 1391 | | |
1393 | 1392 | | |
1394 | 1393 | | |
1395 | 1394 | | |
1396 | | - | |
1397 | | - | |
| 1395 | + | |
1398 | 1396 | | |
1399 | 1397 | | |
1400 | | - | |
1401 | | - | |
| 1398 | + | |
1402 | 1399 | | |
1403 | 1400 | | |
1404 | 1401 | | |
| |||
1454 | 1451 | | |
1455 | 1452 | | |
1456 | 1453 | | |
1457 | | - | |
1458 | | - | |
| 1454 | + | |
1459 | 1455 | | |
1460 | 1456 | | |
1461 | 1457 | | |
| |||
2728 | 2724 | | |
2729 | 2725 | | |
2730 | 2726 | | |
2731 | | - | |
2732 | | - | |
2733 | | - | |
2734 | | - | |
2735 | 2727 | | |
2736 | 2728 | | |
2737 | 2729 | | |
2738 | | - | |
2739 | | - | |
2740 | | - | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
2741 | 2733 | | |
2742 | 2734 | | |
2743 | 2735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5471 | 5471 | | |
5472 | 5472 | | |
5473 | 5473 | | |
5474 | | - | |
5475 | | - | |
| 5474 | + | |
| 5475 | + | |
| 5476 | + | |
| 5477 | + | |
| 5478 | + | |
| 5479 | + | |
5476 | 5480 | | |
5477 | | - | |
5478 | | - | |
5479 | | - | |
| 5481 | + | |
| 5482 | + | |
| 5483 | + | |
| 5484 | + | |
| 5485 | + | |
| 5486 | + | |
| 5487 | + | |
| 5488 | + | |
| 5489 | + | |
| 5490 | + | |
5480 | 5491 | | |
5481 | | - | |
| 5492 | + | |
5482 | 5493 | | |
5483 | | - | |
5484 | | - | |
5485 | | - | |
5486 | | - | |
5487 | | - | |
| 5494 | + | |
| 5495 | + | |
5488 | 5496 | | |
5489 | 5497 | | |
5490 | 5498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
| 2279 | + | |
| 2280 | + | |
2279 | 2281 | | |
2280 | 2282 | | |
2281 | 2283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
711 | 726 | | |
712 | 727 | | |
713 | 728 | | |
714 | 729 | | |
715 | 730 | | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
716 | 742 | | |
717 | 743 | | |
718 | 744 | | |
| |||
737 | 763 | | |
738 | 764 | | |
739 | 765 | | |
740 | | - | |
| 766 | + | |
741 | 767 | | |
742 | 768 | | |
743 | | - | |
| 769 | + | |
744 | 770 | | |
745 | 771 | | |
746 | 772 | | |
| |||
766 | 792 | | |
767 | 793 | | |
768 | 794 | | |
769 | | - | |
770 | | - | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
771 | 803 | | |
772 | 804 | | |
773 | 805 | | |
| |||
782 | 814 | | |
783 | 815 | | |
784 | 816 | | |
785 | | - | |
786 | | - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
787 | 820 | | |
788 | 821 | | |
789 | 822 | | |
| |||
800 | 833 | | |
801 | 834 | | |
802 | 835 | | |
803 | | - | |
| 836 | + | |
804 | 837 | | |
805 | | - | |
| 838 | + | |
| 839 | + | |
806 | 840 | | |
807 | 841 | | |
808 | 842 | | |
809 | | - | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
810 | 851 | | |
811 | | - | |
| 852 | + | |
| 853 | + | |
812 | 854 | | |
813 | 855 | | |
814 | 856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| |||
0 commit comments