| 367 | } |
| 368 | |
| 369 | Result SharedValidator::EndModule() { |
| 370 | // Verify that any ref.func used in init expressions for globals are |
| 371 | // mentioned in an elems section. This can't be done while process the |
| 372 | // globals because the global section comes before the elem section. |
| 373 | Result result = Result::Ok; |
| 374 | for (Var func_var : check_declared_funcs_) { |
| 375 | result |= CheckDeclaredFunc(func_var); |
| 376 | } |
| 377 | return result; |
| 378 | } |
| 379 | |
| 380 | Result SharedValidator::CheckIndex(Var var, Index max_index, const char* desc) { |
| 381 | if (var.index() >= max_index) { |