@@ -322,11 +322,12 @@ void dump_ct::convert_compound(
322322 if (!system_symbols.is_symbol_internal_symbol (symbol, system_headers))
323323 convert_compound (symbol.type , unresolved, recursive, os);
324324 }
325- else if (type.id ()==ID_c_enum_tag)
325+ else if (
326+ type.id () == ID_c_enum_tag || type.id () == ID_struct_tag ||
327+ type.id () == ID_union_tag)
326328 {
327- const symbolt &symbol=
328- ns.lookup (to_c_enum_tag_type (type).get_identifier ());
329- DATA_INVARIANT (symbol.is_type , " symbol expected to be type symbol" );
329+ const symbolt &symbol = ns.lookup (to_tag_type (type));
330+ DATA_INVARIANT (symbol.is_type , " tag expected to be type symbol" );
330331
331332 if (!system_symbols.is_symbol_internal_symbol (symbol, system_headers))
332333 convert_compound (symbol.type , unresolved, recursive, os);
@@ -674,6 +675,13 @@ void dump_ct::collect_typedefs_rec(
674675 ns.lookup (to_symbol_type (type).get_identifier ());
675676 collect_typedefs_rec (symbol.type , early, local_deps);
676677 }
678+ else if (
679+ type.id () == ID_c_enum_tag || type.id () == ID_struct_tag ||
680+ type.id () == ID_union_tag)
681+ {
682+ const symbolt &symbol = ns.lookup (to_tag_type (type));
683+ collect_typedefs_rec (symbol.type , early, local_deps);
684+ }
677685
678686 const irep_idt &typedef_str=type.get (ID_C_typedef);
679687
0 commit comments