| 576 | dispatch_item(field_item, field_cs); |
| 577 | } |
| 578 | void Checker::dispatch_class(const QueueItem & item, const CheckedStructure & cs) |
| 579 | { |
| 580 | auto vtable_name = get_vtable_name(item, cs); |
| 581 | if (!vtable_name) |
| 582 | { |
| 583 | // bail out now because virtual_identity::get will crash |
| 584 | return; |
| 585 | } |
| 586 | |
| 587 | auto base_identity = static_cast<const virtual_identity *>(cs.identity); |
| 588 | auto vptr = static_cast<virtual_ptr>(const_cast<void *>(item.ptr)); |
| 589 | auto identity = virtual_identity::get(vptr); |
| 590 | if (!identity) |
| 591 | { |
| 592 | FAIL("unidentified subclass of " << base_identity->getFullName() << ": " << vtable_name); |
| 593 | return; |
| 594 | } |
| 595 | if (base_identity != identity && !base_identity->is_subclass(identity)) |
| 596 | { |
| 597 | FAIL("expected subclass of " << base_identity->getFullName() << ", but got " << identity->getFullName()); |
| 598 | return; |
| 599 | } |
| 600 | |
| 601 | if (data.count(item.ptr) && data.at(item.ptr).first == item.path) |
| 602 | { |
| 603 | // TODO: handle cases where this may overlap later data |
| 604 | data.at(item.ptr).second.identity = identity; |
| 605 | } |
| 606 | |
| 607 | dispatch_struct(QueueItem(item.path + "<" + identity->getFullName() + ">", item.ptr), CheckedStructure(identity)); |
| 608 | } |
| 609 | void Checker::dispatch_buffer(const QueueItem & item, const CheckedStructure & cs) |
| 610 | { |
| 611 | auto identity = static_cast<const container_identity *>(cs.identity); |
nothing calls this directly
no test coverage detected