@@ -103,6 +103,10 @@ xmlt xml(const typet &type, const namespacet &ns)
103
103
e.new_element (" type" ).new_element () = xml (component.type (), ns);
104
104
}
105
105
}
106
+ else if (type.id () == ID_struct_tag)
107
+ {
108
+ return xml (ns.follow_tag (to_struct_tag_type (type)), ns);
109
+ }
106
110
else if (type.id () == ID_union)
107
111
{
108
112
result.name = " union" ;
@@ -115,6 +119,10 @@ xmlt xml(const typet &type, const namespacet &ns)
115
119
e.new_element (" type" ).new_element () = xml (component.type (), ns);
116
120
}
117
121
}
122
+ else if (type.id () == ID_union_tag)
123
+ {
124
+ return xml (ns.follow_tag (to_union_tag_type (type)), ns);
125
+ }
118
126
else
119
127
result.name = " unknown" ;
120
128
@@ -125,12 +133,12 @@ xmlt xml(const exprt &expr, const namespacet &ns)
125
133
{
126
134
xmlt result;
127
135
128
- const typet &type = ns.follow (expr.type ());
129
-
130
136
if (expr.id () == ID_constant)
131
137
{
132
138
const auto &constant_expr = to_constant_expr (expr);
133
139
140
+ const typet &type = expr.type ();
141
+
134
142
if (
135
143
type.id () == ID_unsignedbv || type.id () == ID_signedbv ||
136
144
type.id () == ID_c_bit_field || type.id () == ID_c_bool)
@@ -238,6 +246,8 @@ xmlt xml(const exprt &expr, const namespacet &ns)
238
246
{
239
247
result.name = " struct" ;
240
248
249
+ const typet &type = ns.follow (expr.type ());
250
+
241
251
// these are expected to have a struct type
242
252
if (type.id () == ID_struct)
243
253
{
0 commit comments