()
| 165 | |
| 166 | #[test] |
| 167 | fn infinite_wasm_stack_does_not_panic() -> Result<()> { |
| 168 | let mut config = Config::new(); |
| 169 | config.max_wasm_stack(usize::MAX); |
| 170 | config.async_stack_size(usize::MAX); |
| 171 | let engine = Engine::new(&config)?; |
| 172 | // If the store can't get allocated that's probably because we're using |
| 173 | // pulley and can't allocate a usize::MAX stack, ignore that failure. |
| 174 | // This'll still run on cranelift-native platforms. |
| 175 | let Ok(mut store) = Store::try_new(&engine, ()) else { |
| 176 | return Ok(()); |
| 177 | }; |
| 178 | let module = Module::new(store.engine(), r#"(module (func (export "f")))"#)?; |
| 179 | let instance = Instance::new(&mut store, &module, &[])?; |
| 180 | let func = instance.get_typed_func::<(), ()>(&mut store, "f")?; |
| 181 | func.call(&mut store, ())?; |
| 182 | Ok(()) |
| 183 | } |
nothing calls this directly
no test coverage detected