Commit d61497b
committed
fix lowering results for async exports
Previously, we were either dropping the result too early
(e.g. `wit_bindgen_rt::async_support::ErrorContext`) or not at all
(e.g. `String` and `Vec`) due to the lowering code expecting to pass ownership
to the caller, which would later free memory using a post-return function. But
async exports don't have post-return functions; they use `task.return` instead,
and they should free any memory (and/or drop handles) after `task.return`
returns. So now we do that!
Signed-off-by: Joel Dice <joel.dice@fermyon.com>1 parent 5905093 commit d61497b
2 files changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
1480 | | - | |
1481 | | - | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
1482 | 1483 | | |
1483 | 1484 | | |
1484 | 1485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
0 commit comments