File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,14 @@ bvt boolbvt::convert_array_of(const array_of_exprt &expr)
2525 std::size_t width=boolbv_width (array_type);
2626
2727 if (width==0 )
28- return conversion_failed (expr);
28+ {
29+ // A zero-length array is acceptable;
30+ // an element with unknown size is not.
31+ if (boolbv_width (array_type.subtype ())==0 )
32+ return conversion_failed (expr);
33+ else
34+ return bvt ();
35+ }
2936
3037 const exprt &array_size=array_type.size ();
3138
Original file line number Diff line number Diff line change @@ -37,7 +37,13 @@ bvt boolbvt::convert_with(const exprt &expr)
3737 std::size_t width=boolbv_width (expr.type ());
3838
3939 if (width==0 )
40- return conversion_failed (expr);
40+ {
41+ // A zero-length array is acceptable:
42+ if (expr.type ().id ()==ID_array && boolbv_width (expr.type ().subtype ())!=0 )
43+ return bvt ();
44+ else
45+ return conversion_failed (expr);
46+ }
4147
4248 if (bv.size ()!=width)
4349 {
You can’t perform that action at this time.
0 commit comments