(&self)
| 120 | } |
| 121 | |
| 122 | pub fn val(&self) -> Val { |
| 123 | match self.kind { |
| 124 | WASM_I32 => Val::from(unsafe { self.of.i32 }), |
| 125 | WASM_I64 => Val::from(unsafe { self.of.i64 }), |
| 126 | WASM_F32 => Val::from(unsafe { self.of.f32 }), |
| 127 | WASM_F64 => Val::from(unsafe { self.of.f64 }), |
| 128 | #[cfg(feature = "gc")] |
| 129 | WASM_FUNCREF => unsafe { |
| 130 | if self.of.ref_.is_null() { |
| 131 | Val::FuncRef(None) |
| 132 | } else { |
| 133 | ref_to_val(&*self.of.ref_) |
| 134 | } |
| 135 | }, |
| 136 | _ => crate::abort("unsupported val discriminant"), |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | #[unsafe(no_mangle)] |
no test coverage detected