(
instance: Option<u32>,
store: &mut Store,
name: &str,
args: &[WasmValue],
)
| 666 | } |
| 667 | |
| 668 | fn exec_fn_instance( |
| 669 | instance: Option<u32>, |
| 670 | store: &mut Store, |
| 671 | name: &str, |
| 672 | args: &[WasmValue], |
| 673 | ) -> Result<Vec<WasmValue>, tinywasm::Error> { |
| 674 | let Some(instance) = instance else { |
| 675 | return Err(tinywasm::Error::Other("no instance found".to_string())); |
| 676 | }; |
| 677 | let Some(instance) = store.get_module_instance(instance) else { |
| 678 | return Err(tinywasm::Error::Other("no instance found".to_string())); |
| 679 | }; |
| 680 | let func = instance.func_untyped(store, name)?; |
| 681 | exec_with_budget(&func, store, args) |
| 682 | } |
| 683 | |
| 684 | fn catch_unwind_silent<R>(f: impl FnOnce() -> R) -> std::thread::Result<R> { |
| 685 | let prev_hook = panic::take_hook(); |
no test coverage detected