(&self, item: &ElementItem, globals: &[Addr], funcs: &[FuncAddr])
| 394 | } |
| 395 | |
| 396 | fn elem_addr(&self, item: &ElementItem, globals: &[Addr], funcs: &[FuncAddr]) -> Result<Option<u32>> { |
| 397 | let res = match item { |
| 398 | ElementItem::Func(addr) => match funcs.get(*addr as usize) { |
| 399 | Some(func_addr) => Some(*func_addr), |
| 400 | None => { |
| 401 | cold_path(); |
| 402 | return Err(Error::Other(format!( |
| 403 | "function {addr} not found. This should have been caught by the validator" |
| 404 | ))); |
| 405 | } |
| 406 | }, |
| 407 | ElementItem::Expr(expr) => self.eval_ref_const(expr, globals, funcs)?, |
| 408 | }; |
| 409 | |
| 410 | Ok(res) |
| 411 | } |
| 412 | |
| 413 | /// Add elements to the store, returning their addresses in the store |
| 414 | /// Should be called after the tables have been added |
no test coverage detected