Skip to content

Commit 6b6302e

Browse files
authored
Merge pull request #3043 from hannes-steffenhagen-diffblue/feature-invariant_cleanup-flattening-if
Use expected_width parameter in flattening/boolbv_if to simplify error handling
2 parents 095fb3d + 2ab7ac7 commit 6b6302e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/solvers/flattening/boolbv_if.cpp

Lines changed: 3 additions & 6 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 &op1_bv=convert_bv(expr.true_case());
22-
const bvt &op2_bv=convert_bv(expr.false_case());
21+
const bvt &true_case_bv = convert_bv(expr.true_case(), width);
22+
const bvt &false_case_bv = convert_bv(expr.false_case(), width);
2323

24-
if(op1_bv.size()!=width || op2_bv.size()!=width)
25-
throw "operand size mismatch for if "+expr.pretty();
26-
27-
return bv_utils.select(cond, op1_bv, op2_bv);
24+
return bv_utils.select(cond, true_case_bv, false_case_bv);
2825
}

0 commit comments

Comments
 (0)