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

Function wasm_trap_origin

crates/c-api/src/trap.rs:140–155  ·  view source on GitHub ↗
(raw: &wasm_trap_t)

Source from the content-addressed store, hash-verified

138
139#[unsafe(no_mangle)]
140pub extern "C" fn wasm_trap_origin(raw: &wasm_trap_t) -> Option<Box<wasm_frame_t<'_>>> {
141 let trace = match raw.error.downcast_ref::<WasmBacktrace>() {
142 Some(trap) => trap,
143 None => return None,
144 };
145 if trace.frames().len() > 0 {
146 Some(Box::new(wasm_frame_t {
147 trace,
148 idx: 0,
149 func_name: OnceCell::new(),
150 module_name: OnceCell::new(),
151 }))
152 } else {
153 None
154 }
155}
156
157#[unsafe(no_mangle)]
158pub extern "C" fn wasm_trap_trace<'a>(raw: &'a wasm_trap_t, out: &mut wasm_frame_vec_t<'a>) {

Callers 1

wasm.hFile · 0.85

Calls 3

newFunction · 0.50
lenMethod · 0.45
framesMethod · 0.45

Tested by

no test coverage detected