properly check fields of the full type heirarchy

develop
Ben Lubar 2020-02-12 18:01:49 -06:00
parent 24918e5513
commit 9c34e9e584
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
1 changed files with 12 additions and 5 deletions

@ -751,13 +751,20 @@ void Checker::check_bitvector(const ToCheck & item)
void Checker::check_struct(const ToCheck & item)
{
auto identity = static_cast<struct_identity *>(item.identity);
for (auto field = identity->getFields(); field->mode != struct_field_info::END; field++)
for (auto identity = static_cast<struct_identity *>(item.identity); identity; identity = identity->getParent())
{
ToCheck child(item, std::string(".") + field->name, PTR_ADD(item.ptr, field->offset), field->type);
auto fields = identity->getFields();
if (!fields)
{
continue;
}
for (auto field = fields; field->mode != struct_field_info::END; field++)
{
ToCheck child(item, std::string(".") + field->name, PTR_ADD(item.ptr, field->offset), field->type);
queue_field(std::move(child), field);
queue_field(std::move(child), field);
}
}
}