| 1401 | } |
| 1402 | |
| 1403 | Result WastParser::ResolveTargetRefType(const Module& module, |
| 1404 | Type* type, |
| 1405 | const Var& var, |
| 1406 | Errors* errors) { |
| 1407 | assert(type->IsReferenceWithIndex() && !var.is_index()); |
| 1408 | |
| 1409 | if (type->GetReferenceIndex() != kInvalidIndex) { |
| 1410 | // Type has either a name or an absolute index. The former might |
| 1411 | // be resolved earlier, and the latter does not need any resolving. |
| 1412 | return Result::Ok; |
| 1413 | } |
| 1414 | |
| 1415 | Index type_index = module.type_bindings.FindIndex(var.name()); |
| 1416 | |
| 1417 | if (type_index != kInvalidIndex) { |
| 1418 | *type = Type(static_cast<Type::Enum>(*type), type_index); |
| 1419 | return Result::Ok; |
| 1420 | } |
| 1421 | |
| 1422 | errors->emplace_back( |
| 1423 | ErrorLevel::Error, var.loc, module.filename, |
| 1424 | StringPrintf("undefined reference type name %s", var.name().c_str())); |
| 1425 | return Result::Ok; |
| 1426 | } |
| 1427 | |
| 1428 | Result WastParser::ResolveTargetTypeVector(const Module& module, |
| 1429 | TypeVector* types, |
nothing calls this directly
no test coverage detected