MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / check_trap

Function check_trap

examples/multimemory.c:84–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void check_trap(wasmtime_context_t *store, wasmtime_func_t *func,
85 const wasmtime_val_t *args, size_t nargs, size_t num_results) {
86 assert(num_results <= 1);
87 wasmtime_val_t results[1];
88 wasm_trap_t *trap = NULL;
89 wasmtime_error_t *error =
90 wasmtime_func_call(store, func, args, nargs, results, num_results, &trap);
91 if (error != NULL)
92 exit_with_error("failed to call function", error, NULL);
93 if (trap == NULL) {
94 printf("> Error on result, expected trap\n");
95 exit(1);
96 }
97 wasm_trap_delete(trap);
98}
99
100void check_trap1(wasmtime_context_t *store, wasmtime_func_t *func,
101 int32_t arg) {

Callers 2

check_trap1Function · 0.70
check_trap2Function · 0.70

Calls 3

assertFunction · 0.85
wasmtime_func_callFunction · 0.85
exit_with_errorFunction · 0.70

Tested by

no test coverage detected