| 2120 | } |
| 2121 | |
| 2122 | fn visit_ref_null(&mut self, hty: HeapType) -> Self::Output { |
| 2123 | match hty { |
| 2124 | HeapType::FUNC => { |
| 2125 | let ptr_type = self.env.ptr_type(); |
| 2126 | match ptr_type { |
| 2127 | WasmValType::I64 => self.context.stack.push(Val::i64(0)), |
| 2128 | WasmValType::I32 => self.context.stack.push(Val::i32(0)), |
| 2129 | _ => bail!(CodeGenError::unsupported_wasm_type()), |
| 2130 | } |
| 2131 | Ok(()) |
| 2132 | } |
| 2133 | _ => Err(format_err!(CodeGenError::unsupported_wasm_type())), |
| 2134 | } |
| 2135 | } |
| 2136 | |
| 2137 | fn visit_ref_is_null(&mut self) -> Self::Output { |
| 2138 | let (zero, size) = match self.env.ptr_type() { |