Skip to content

Commit ed9cee7

Browse files
committed
add component-model-async/lift.wast test
This is another piece of bytecodealliance#9582 which I'm splitting out to make review easier. This test includes two components: one which exports a function using the async-with-callback ABI, and another which uses the async-without-callback ABI. It doesn't actually instantiate or run either component yet. The rest of the changes fill in some TODOs to make the test pass. Signed-off-by: Joel Dice <[email protected]>
1 parent 3ba13d1 commit ed9cee7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/wasmtime/src/runtime/vm/component.rs

+9
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,15 @@ impl ComponentInstance {
385385
}
386386
}
387387

388+
/// Same as `set_runtime_memory` but for async callback function pointers.
389+
pub fn set_runtime_callback(&mut self, idx: RuntimeCallbackIndex, ptr: NonNull<VMFuncRef>) {
390+
unsafe {
391+
let storage = self.vmctx_plus_offset_mut(self.offsets.runtime_callback(idx));
392+
debug_assert!(*storage as usize == INVALID_PTR);
393+
*storage = ptr.as_ptr();
394+
}
395+
}
396+
388397
/// Same as `set_runtime_memory` but for post-return function pointers.
389398
pub fn set_runtime_post_return(
390399
&mut self,

0 commit comments

Comments
 (0)