(arg: wast::WastArg)
| 736 | } |
| 737 | |
| 738 | fn wastarg2tinywasmvalue(arg: wast::WastArg) -> Result<WasmValue> { |
| 739 | let wast::WastArg::Core(arg) = arg else { bail!("unsupported arg type: Component") }; |
| 740 | use wast::core::WastArgCore::*; |
| 741 | Ok(match arg { |
| 742 | F32(f) => WasmValue::F32(f32::from_bits(f.bits)), |
| 743 | F64(f) => WasmValue::F64(f64::from_bits(f.bits)), |
| 744 | I32(i) => WasmValue::I32(i), |
| 745 | I64(i) => WasmValue::I64(i), |
| 746 | V128(i) => WasmValue::V128(i.to_le_bytes()), |
| 747 | RefExtern(v) => WasmValue::RefExtern(ExternRef::new(Some(v))), |
| 748 | RefNull(t) => match t { |
| 749 | wast::core::HeapType::Abstract { shared: false, ty: AbstractHeapType::Func } => { |
| 750 | WasmValue::RefFunc(FuncRef::null()) |
| 751 | } |
| 752 | wast::core::HeapType::Abstract { shared: false, ty: AbstractHeapType::Extern } => { |
| 753 | WasmValue::RefExtern(ExternRef::null()) |
| 754 | } |
| 755 | _ => bail!("unsupported arg type: refnull: {:?}", t), |
| 756 | }, |
| 757 | RefHost(_) => bail!("unsupported arg type: RefHost"), |
| 758 | }) |
| 759 | } |
| 760 | |
| 761 | fn wast_v128_to_bytes(i: wast::core::V128Pattern) -> [u8; 16] { |
| 762 | let res: Vec<u8> = match i { |
nothing calls this directly
no test coverage detected