(ret: wast::core::WastRetCore)
| 785 | } |
| 786 | |
| 787 | fn wastretcore2tinywasmvalue(ret: wast::core::WastRetCore) -> Result<WasmValue> { |
| 788 | use wast::core::WastRetCore::{F32, F64, I32, I64, RefExtern, RefFunc, RefNull, V128}; |
| 789 | Ok(match ret { |
| 790 | F32(f) => nanpattern2tinywasmvalue(f)?, |
| 791 | F64(f) => nanpattern2tinywasmvalue(f)?, |
| 792 | I32(i) => WasmValue::I32(i), |
| 793 | I64(i) => WasmValue::I64(i), |
| 794 | V128(i) => WasmValue::V128(wast_v128_to_bytes(i)), |
| 795 | RefNull(t) => match t { |
| 796 | Some(wast::core::HeapType::Abstract { shared: false, ty: AbstractHeapType::Func }) => { |
| 797 | WasmValue::RefFunc(FuncRef::null()) |
| 798 | } |
| 799 | Some(wast::core::HeapType::Abstract { shared: false, ty: AbstractHeapType::Extern }) => { |
| 800 | WasmValue::RefExtern(ExternRef::null()) |
| 801 | } |
| 802 | _ => bail!("unsupported arg type: refnull: {:?}", t), |
| 803 | }, |
| 804 | RefExtern(v) => WasmValue::RefExtern(ExternRef::new(v)), |
| 805 | RefFunc(v) => WasmValue::RefFunc(FuncRef::new(match v { |
| 806 | Some(wast::token::Index::Num(n, _)) => Some(n), |
| 807 | _ => bail!("unsupported arg type: reffunc: {:?}", v), |
| 808 | })), |
| 809 | a => bail!("unsupported arg type {:?}", a), |
| 810 | }) |
| 811 | } |
| 812 | |
| 813 | enum Bits { |
| 814 | U32(u32), |
nothing calls this directly
no test coverage detected