MCPcopy Create free account
hub / github.com/WebAssembly/wasm-c-api / fail_callback

Function fail_callback

example/trap.cc:10–17  ·  view source on GitHub ↗

A function to be called from Wasm code.

Source from the content-addressed store, hash-verified

8
9// A function to be called from Wasm code.
10auto fail_callback(
11 void* env, const wasm::vec<wasm::Val>& args, wasm::vec<wasm::Val>& results
12) -> wasm::own<wasm::Trap> {
13 std::cout << "Calling back..." << std::endl;
14 auto store = reinterpret_cast<wasm::Store*>(env);
15 auto message = wasm::Name::make_nt(std::string("callback abort"));
16 return wasm::Trap::make(store, message);
17}
18
19
20void print_frame(const wasm::Frame* frame) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected