MCPcopy Create free account
hub / github.com/WebAssembly/wabt / OnRefNull

Method OnRefNull

src/shared-validator.cc:1177–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1175}
1176
1177Result 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
1200Result SharedValidator::OnRethrow(const Location& loc, Var depth) {
1201 Result result = CheckInstr(Opcode::Rethrow, loc);

Callers 2

OnRefNullExprMethod · 0.80
OnRefNullExprMethod · 0.80

Calls 2

to_typeMethod · 0.80
OnRefNullExprMethod · 0.45

Tested by

no test coverage detected