(&mut self, host_func: Rc<HostFunction>)
| 971 | } |
| 972 | |
| 973 | fn exec_call_host(&mut self, host_func: Rc<HostFunction>) -> Result<(), Trap> { |
| 974 | let mut params = self.store.value_stack.pop_types(host_func.ty.params().iter().rev()).collect::<Vec<_>>(); |
| 975 | params.reverse(); |
| 976 | let res = match host_func.call(FuncContext { store: self.store, module_addr: self.module.idx() }, ¶ms) { |
| 977 | Ok(res) => res, |
| 978 | Err(err) => { |
| 979 | cold_path(); |
| 980 | return Err(Trap::HostFunction(Box::new(err))); |
| 981 | } |
| 982 | }; |
| 983 | |
| 984 | self.store.value_stack.extend_from_wasmvalues(&res)?; |
| 985 | self.cf.incr_instr_ptr(); |
| 986 | Ok(()) |
| 987 | } |
| 988 | |
| 989 | fn exec_call_direct(&mut self, v: u32) -> Result<(), Trap> { |
| 990 | self.charge_call_fuel(FUEL_COST_CALL_TOTAL); |
no test coverage detected