(func_ty: &FuncType, params: &[WasmValue])
| 506 | } |
| 507 | |
| 508 | fn validate_call_params(func_ty: &FuncType, params: &[WasmValue]) -> Result<()> { |
| 509 | if unlikely(func_ty.params().len() != params.len()) { |
| 510 | return Err(Error::Other(format!( |
| 511 | "param count mismatch: expected {}, got {}", |
| 512 | func_ty.params().len(), |
| 513 | params.len() |
| 514 | ))); |
| 515 | } |
| 516 | |
| 517 | if !(func_ty.params().iter().zip(params).all(|(ty, param)| ty == ¶m.into())) { |
| 518 | return Err(Error::other("Type mismatch")); |
| 519 | } |
| 520 | |
| 521 | Ok(()) |
| 522 | } |
| 523 | |
| 524 | fn collect_call_results(value_stack: &mut ValueStack, func_ty: &FuncType) -> Result<Vec<WasmValue>> { |
| 525 | debug_assert!(value_stack.len() >= func_ty.results().len()); // m values are on the top of the stack (Ensured by validation) |
no test coverage detected