MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / exec_fn_instance

Function exec_fn_instance

crates/cli/src/wast_runner.rs:668–682  ·  view source on GitHub ↗
(
    instance: Option<u32>,
    store: &mut Store,
    name: &str,
    args: &[WasmValue],
)

Source from the content-addressed store, hash-verified

666}
667
668fn 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
684fn catch_unwind_silent<R>(f: impl FnOnce() -> R) -> std::thread::Result<R> {
685 let prev_hook = panic::take_hook();

Callers 1

run_fileMethod · 0.85

Calls 3

exec_with_budgetFunction · 0.85
get_module_instanceMethod · 0.80
func_untypedMethod · 0.80

Tested by

no test coverage detected