File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2672,7 +2672,14 @@ void smt2_convt::convert_struct(const struct_exprt &expr)
2672
2672
2673
2673
// may need to flatten array-theory arrays in there
2674
2674
if (op.type ().id () == ID_array)
2675
- flatten_array (op);
2675
+ {
2676
+ const array_typet &array_type = to_array_type (op.type ());
2677
+ const auto &size_expr = array_type.size ();
2678
+ CHECK_RETURN (size_expr.id () == ID_constant);
2679
+
2680
+ if (numeric_cast_v<mp_integer>(to_constant_expr (size_expr)) != 0 )
2681
+ flatten_array (op);
2682
+ }
2676
2683
else
2677
2684
convert_expr (op);
2678
2685
@@ -4526,7 +4533,11 @@ void smt2_convt::convert_type(const typet &type)
4526
4533
{
4527
4534
if (use_datatypes)
4528
4535
{
4529
- out << datatype_map.at (type);
4536
+ const typet &struct_type = type.id () == ID_struct_tag
4537
+ ? ns.follow_tag (to_struct_tag_type (type))
4538
+ : type;
4539
+ CHECK_RETURN (datatype_map.count (struct_type) > 0 );
4540
+ out << datatype_map.at (struct_type);
4530
4541
}
4531
4542
else
4532
4543
{
You can’t perform that action at this time.
0 commit comments