We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7235f23 commit b2390e4Copy full SHA for b2390e4
src/util/simplify_expr_int.cpp
@@ -781,16 +781,16 @@ bool simplify_exprt::simplify_bitwise(exprt &expr)
781
782
if(expr.id()==ID_bitand)
783
{
784
+ const auto all_ones = power(2, width) - 1;
785
for(exprt::operandst::iterator
786
it=expr.operands().begin();
787
it!=expr.operands().end();
788
) // no it++
789
790
if(
791
it->is_constant() &&
- bvrep2integer(
792
- to_constant_expr(*it).get_value(), width, false) ==
793
- power(2, width) - 1 &&
+ bvrep2integer(to_constant_expr(*it).get_value(), width, false) ==
+ all_ones &&
794
expr.operands().size() > 1)
795
796
it=expr.operands().erase(it);
0 commit comments