Skip to content

Commit 69b534d

Browse files
Allow empty arrays in convert_array
1 parent ac7092c commit 69b534d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/solvers/flattening/boolbv_array.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ Author: Daniel Kroening, [email protected]
1212

1313
bvt boolbvt::convert_array(const exprt &expr)
1414
{
15-
std::size_t width=boolbv_width(expr.type());
15+
const std::size_t width = boolbv_width(expr.type());
16+
const exprt::operandst &operands = expr.operands();
1617

17-
if(width==0)
18-
return conversion_failed(expr);
18+
if(operands.empty() && width == 0)
19+
return bvt();
1920

2021
if(expr.type().id()==ID_array)
2122
{
@@ -24,7 +25,7 @@ bvt boolbvt::convert_array(const exprt &expr)
2425
"the bit width being nonzero implies that the array has a nonzero size "
2526
"in which case the array shall have operands");
2627
const exprt::operandst &operands=expr.operands();
27-
std::size_t op_width=width/operands.size();
28+
const std::size_t op_width = width / operands.size();
2829

2930
bvt bv;
3031
bv.reserve(width);

0 commit comments

Comments
 (0)