Skip to content

Commit 25ef8c4

Browse files
Allow empty arrays in convert_array
1 parent bb28030 commit 25ef8c4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/solvers/flattening/boolbv_array.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ Author: Daniel Kroening, [email protected]
1111

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

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

1920
if(expr.type().id()==ID_array)
2021
{
21-
assert(expr.has_operands());
22-
const exprt::operandst &operands=expr.operands();
2322
assert(!operands.empty());
24-
std::size_t op_width=width/operands.size();
23+
const std::size_t op_width = width / operands.size();
2524

2625
bvt bv;
2726
bv.reserve(width);

0 commit comments

Comments
 (0)