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)
25
25
std::size_t width=boolbv_width (array_type);
26
26
27
27
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
+ }
29
36
30
37
const exprt &array_size=array_type.size ();
31
38
Original file line number Diff line number Diff line change @@ -37,7 +37,13 @@ bvt boolbvt::convert_with(const exprt &expr)
37
37
std::size_t width=boolbv_width (expr.type ());
38
38
39
39
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
+ }
41
47
42
48
if (bv.size ()!=width)
43
49
{
You can’t perform that action at this time.
0 commit comments