| 524 | const flatbuffers::Table *table, bool required); |
| 525 | |
| 526 | bool VerifyUnion(flatbuffers::Verifier &v, const reflection::Schema &schema, |
| 527 | uint8_t utype, const uint8_t *elem, |
| 528 | const reflection::Field &union_field) { |
| 529 | if (!utype) return true; // Not present. |
| 530 | auto fb_enum = schema.enums()->Get(union_field.type()->index()); |
| 531 | if (utype >= fb_enum->values()->size()) return false; |
| 532 | auto elem_type = fb_enum->values()->Get(utype)->union_type(); |
| 533 | switch (elem_type->base_type()) { |
| 534 | case reflection::Obj: { |
| 535 | auto elem_obj = schema.objects()->Get(elem_type->index()); |
| 536 | if (elem_obj->is_struct()) { |
| 537 | return v.VerifyFromPointer(elem, elem_obj->bytesize()); |
| 538 | } else { |
| 539 | return VerifyObject(v, schema, *elem_obj, |
| 540 | reinterpret_cast<const flatbuffers::Table *>(elem), |
| 541 | true); |
| 542 | } |
| 543 | } |
| 544 | case reflection::String: |
| 545 | return v.VerifyString( |
| 546 | reinterpret_cast<const flatbuffers::String *>(elem)); |
| 547 | default: return false; |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | bool VerifyVector(flatbuffers::Verifier &v, const reflection::Schema &schema, |
| 552 | const flatbuffers::Table &table, |
no test coverage detected