Skip to content

Commit fad0e20

Browse files
committed
Remove lambda in convert_binary_overflow
1 parent c5c5e91 commit fad0e20

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/solvers/flattening/boolbv_overflow.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,20 @@ literalt boolbvt::convert_binary_overflow(const binary_overflow_exprt &expr)
2626
? bv_utilst::representationt::SIGNED
2727
: bv_utilst::representationt::UNSIGNED;
2828

29-
const auto plus_or_minus_conversion =
30-
[&](
31-
const binary_overflow_exprt &overflow_expr,
32-
const std::function<literalt(
33-
bv_utilst *, const bvt &, const bvt &, bv_utilst::representationt)>
34-
&bv_util_overflow) {
35-
36-
if(bv0.size() != bv1.size())
37-
return SUB::convert_rest(expr);
38-
39-
return bv_util_overflow(&bv_utils, bv0, bv1, rep);
40-
};
4129
if(
4230
const auto plus_overflow = expr_try_dynamic_cast<plus_overflow_exprt>(expr))
4331
{
44-
return plus_or_minus_conversion(*plus_overflow, &bv_utilst::overflow_add);
32+
if(bv0.size() != bv1.size())
33+
return SUB::convert_rest(expr);
34+
35+
return bv_utils.overflow_add(bv0, bv1, rep);
4536
}
4637
if(const auto minus = expr_try_dynamic_cast<minus_overflow_exprt>(expr))
4738
{
48-
return plus_or_minus_conversion(*minus, &bv_utilst::overflow_sub);
39+
if(bv0.size() != bv1.size())
40+
return SUB::convert_rest(expr);
41+
42+
return bv_utils.overflow_sub(bv0, bv1, rep);
4943
}
5044
else if(
5145
const auto mult_overflow = expr_try_dynamic_cast<mult_overflow_exprt>(expr))

0 commit comments

Comments
 (0)