Commit 407e94a
committed
Preserve pointer provenance in the Rust backend.
Use the new `Pointer` and `Length` types in the Rust backend to emit
code that uses `*mut c_void` and `usize` instead of `i32` when working
with pointers and array lengths.
To represent `PointerOrI64`, use a `MaybeUninit<u64>`, since that type
can hold any `u64` and is documented to also preserve provenance.
This change happens to get the generated Rust code close to supporting
memory64, however it isn't complete; the abi code still emits hard-coded
`+ 4` offsets for loading the length of a pointer+length pair in memory.1 parent ec84c8e commit 407e94a
File tree
9 files changed
+254
-105
lines changed- crates
- core/src
- csharp/src
- c/src
- rust/src
- teavm-java/src
9 files changed
+254
-105
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2205 | 2205 | | |
2206 | 2206 | | |
2207 | 2207 | | |
2208 | | - | |
| 2208 | + | |
2209 | 2209 | | |
2210 | 2210 | | |
2211 | | - | |
| 2211 | + | |
2212 | 2212 | | |
2213 | 2213 | | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2214 | 2217 | | |
2215 | 2218 | | |
2216 | 2219 | | |
| |||
2869 | 2872 | | |
2870 | 2873 | | |
2871 | 2874 | | |
2872 | | - | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
2873 | 2880 | | |
2874 | 2881 | | |
2875 | 2882 | | |
2876 | | - | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
2877 | 2886 | | |
2878 | 2887 | | |
2879 | 2888 | | |
| |||
3015 | 3024 | | |
3016 | 3025 | | |
3017 | 3026 | | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
3018 | 3030 | | |
3019 | 3031 | | |
3020 | 3032 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
141 | 151 | | |
142 | 152 | | |
143 | 153 | | |
| |||
526 | 536 | | |
527 | 537 | | |
528 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
529 | 545 | | |
530 | 546 | | |
531 | 547 | | |
| |||
1517 | 1533 | | |
1518 | 1534 | | |
1519 | 1535 | | |
1520 | | - | |
| 1536 | + | |
1521 | 1537 | | |
1522 | | - | |
| 1538 | + | |
1523 | 1539 | | |
1524 | 1540 | | |
1525 | 1541 | | |
| |||
1689 | 1705 | | |
1690 | 1706 | | |
1691 | 1707 | | |
1692 | | - | |
| 1708 | + | |
1693 | 1709 | | |
1694 | | - | |
| 1710 | + | |
1695 | 1711 | | |
1696 | 1712 | | |
1697 | 1713 | | |
| |||
1742 | 1758 | | |
1743 | 1759 | | |
1744 | 1760 | | |
1745 | | - | |
| 1761 | + | |
1746 | 1762 | | |
1747 | | - | |
| 1763 | + | |
1748 | 1764 | | |
1749 | 1765 | | |
1750 | 1766 | | |
| |||
1772 | 1788 | | |
1773 | 1789 | | |
1774 | 1790 | | |
1775 | | - | |
| 1791 | + | |
1776 | 1792 | | |
1777 | | - | |
| 1793 | + | |
1778 | 1794 | | |
1779 | 1795 | | |
1780 | 1796 | | |
| |||
1862 | 1878 | | |
1863 | 1879 | | |
1864 | 1880 | | |
1865 | | - | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
1866 | 1887 | | |
1867 | 1888 | | |
1868 | 1889 | | |
| |||
1875 | 1896 | | |
1876 | 1897 | | |
1877 | 1898 | | |
1878 | | - | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
1879 | 1912 | | |
1880 | 1913 | | |
1881 | 1914 | | |
| |||
0 commit comments