Skip to content

Commit 2ab7ac7

Browse files
Use convert_bv expected_width parameter in boolbv_if
The second parameter to convert_bv will cause to function to fail if the resulting bitvector doesn't have the width we say it should have. We use this to avoid doing an explicit check in this file.
1 parent b5b989d commit 2ab7ac7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/solvers/flattening/boolbv_if.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ bvt boolbvt::convert_if(const if_exprt &expr)
1818

1919
literalt cond=convert(expr.cond());
2020

21-
const bvt &true_case_bv = convert_bv(expr.true_case());
22-
const bvt &false_case_bv = convert_bv(expr.false_case());
23-
24-
if(true_case_bv.size() != width || false_case_bv.size() != width)
25-
throw "operand size mismatch for if "+expr.pretty();
21+
const bvt &true_case_bv = convert_bv(expr.true_case(), width);
22+
const bvt &false_case_bv = convert_bv(expr.false_case(), width);
2623

2724
return bv_utils.select(cond, true_case_bv, false_case_bv);
2825
}

0 commit comments

Comments
 (0)