Commit 3b839cf
authored
drop borrows earlier for async exports in Rust generator (#1124)
While testing runtime borrow enforcement in Wasmtime, I discovered that the
guest code generated by `wit-bindgen` was not dropping borrows early enough for
async exports. Specifically, all borrows need to be dropped before
`task.return` is called, which is what this patch does.
Signed-off-by: Joel Dice <[email protected]>1 parent 5928056 commit 3b839cf
2 files changed
+24
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
877 | 879 | | |
878 | 880 | | |
879 | 881 | | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
| 882 | + | |
| 883 | + | |
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| |||
950 | 950 | | |
951 | 951 | | |
952 | 952 | | |
| 953 | + | |
953 | 954 | | |
954 | 955 | | |
955 | 956 | | |
| |||
973 | 974 | | |
974 | 975 | | |
975 | 976 | | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
976 | 981 | | |
977 | 982 | | |
978 | 983 | | |
979 | 984 | | |
980 | 985 | | |
981 | 986 | | |
| 987 | + | |
| 988 | + | |
982 | 989 | | |
983 | 990 | | |
984 | 991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
| 1088 | + | |
1088 | 1089 | | |
1089 | 1090 | | |
1090 | 1091 | | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1091 | 1104 | | |
1092 | 1105 | | |
1093 | 1106 | | |
| |||
0 commit comments