| 1175 | } |
| 1176 | |
| 1177 | Result SharedValidator::OnRefNull(const Location& loc, Var func_type_var) { |
| 1178 | Result result = CheckInstr(Opcode::RefNull, loc); |
| 1179 | |
| 1180 | Type type = func_type_var.to_type(); |
| 1181 | |
| 1182 | switch (type) { |
| 1183 | case Type::RefNull: |
| 1184 | result |= CheckIndex(func_type_var, num_types_, "function type"); |
| 1185 | break; |
| 1186 | case Type::FuncRef: |
| 1187 | case Type::ExnRef: |
| 1188 | case Type::ExternRef: |
| 1189 | break; |
| 1190 | default: |
| 1191 | result |= PrintError( |
| 1192 | loc, "Only ref, externref, exnref, funcref are allowed for ref.null"); |
| 1193 | break; |
| 1194 | } |
| 1195 | |
| 1196 | result |= typechecker_.OnRefNullExpr(type); |
| 1197 | return result; |
| 1198 | } |
| 1199 | |
| 1200 | Result SharedValidator::OnRethrow(const Location& loc, Var depth) { |
| 1201 | Result result = CheckInstr(Opcode::Rethrow, loc); |
no test coverage detected