diff --git a/library/xml b/library/xml index fa22bd5c5..614548ce6 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit fa22bd5c5a6ea6ffbd883aea5dfcd2bb18d76dcf +Subproject commit 614548ce67ef3d154297167ecacfd9b8c2d49875 diff --git a/plugins/devel/check-structures-sanity.cpp b/plugins/devel/check-structures-sanity.cpp index 6c9f5fb49..a78718cf9 100644 --- a/plugins/devel/check-structures-sanity.cpp +++ b/plugins/devel/check-structures-sanity.cpp @@ -33,6 +33,10 @@ static command_result command(color_ostream &, std::vector &); #define UNEXPECTED __asm__ volatile ("int $0x03") #endif +#define MIN_SIZE_FOR_SUGGEST 64 +static std::map> known_types_by_size; +static void build_size_table(); + DFhackCExport command_result plugin_init(color_ostream &, std::vector & commands) { commands.push_back(PluginCommand( @@ -51,9 +55,24 @@ DFhackCExport command_result plugin_init(color_ostream &, std::vectorbyte_size() >= MIN_SIZE_FOR_SUGGEST) + { + known_types_by_size[ident->byte_size()].push_back(ident->getFullName()); + } + } +} + static const char *const *get_enum_item_key(enum_identity *identity, int64_t value) { size_t index; @@ -827,6 +846,10 @@ void Checker::check_dispatch(ToCheck & item) item.path.push_back(""); item.identity = df::identity_traits::get(); } + else if (allocated_size >= MIN_SIZE_FOR_SUGGEST && known_types_by_size.count(allocated_size)) + { + FAIL("known types of this size: " << join_strings(", ", known_types_by_size.at(allocated_size))); + } } #ifndef WIN32 else if (auto str = check_possible_stl_string_pointer(&item.ptr))