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

Function stack_values_exceptions

tests/all/debug.rs:151–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149#[test]
150#[cfg_attr(miri, ignore)]
151fn stack_values_exceptions() -> wasmtime::Result<()> {
152 test_stack_values(
153 r#"
154 (module
155 (tag $t (param i32))
156 (import "" "host" (func))
157 (func (export "main")
158 (block $b (result i32)
159 (try_table (catch $t $b)
160 (throw $t (i32.const 42)))
161 i32.const 0)
162 (call 0)
163 (drop)))
164 "#,
165 |_config| {},
166 |mut caller: Caller<'_, ()>| {
167 let stack = caller.debug_exit_frames().next().unwrap();
168 assert_eq!(stack.num_stacks(&mut caller)?, 1);
169 assert_eq!(stack.stack(&mut caller, 0)?.unwrap_i32(), 42);
170 let stack = stack.parent(&mut caller)?;
171 assert!(stack.is_none());
172 Ok(())
173 },
174 )
175}
176
177#[test]
178#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 6

test_stack_valuesFunction · 0.85
OkFunction · 0.85
debug_exit_framesMethod · 0.80
unwrapMethod · 0.45
nextMethod · 0.45
parentMethod · 0.45

Tested by

no test coverage detected