Skip to content

Commit a4c43a7

Browse files
committed
type-to-{JSON,XML}: output array size
We do output the size of vectors, but hadn't done so for arrays for some reason.
1 parent 054ac09 commit a4c43a7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/goto-programs/json_expr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ json_objectt json(const typet &type, const namespacet &ns, const irep_idt &mode)
157157
{
158158
result["name"] = json_stringt("array");
159159
result["subtype"] = json(to_array_type(type).subtype(), ns, mode);
160+
result["size"] = json(to_array_type(type).size(), ns, mode);
160161
}
161162
else if(type.id() == ID_vector)
162163
{

src/goto-programs/xml_expr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ xmlt xml(const typet &type, const namespacet &ns)
8080
result.name = "array";
8181
result.new_element("subtype").new_element() =
8282
xml(to_array_type(type).subtype(), ns);
83+
result.new_element("size").new_element() =
84+
xml(to_array_type(type).size(), ns);
8385
}
8486
else if(type.id() == ID_vector)
8587
{

0 commit comments

Comments
 (0)