check-structures-sanity: report known void* types with a better message

develop
Ben Lubar 2020-04-19 22:03:03 -05:00
parent d3a007489c
commit 2f1e057bc7
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
2 changed files with 5 additions and 1 deletions

@ -67,6 +67,11 @@ bool Checker::queue_item(const QueueItem & item, CheckedStructure cs)
auto offset = uintptr_t(item.ptr) - uintptr_t(prev->first);
if (!prev->second.second.has_type_at_offset(cs, offset))
{
if (offset == 0 && cs.identity == df::identity_traits<void *>::get())
{
FAIL("unknown pointer is " << prev->second.second.identity->getFullName() << ", previously seen at " << prev->second.first);
return false;
}
// TODO
FAIL("TODO: handle merging structures: " << item.path << " overlaps " << prev->second.first << " (backward)");
return false;

@ -129,7 +129,6 @@ bool CheckedStructure::has_type_at_offset(const CheckedStructure & type, size_t
auto st = dynamic_cast<struct_identity *>(identity);
if (!st)
{
UNEXPECTED;
return false;
}