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 6afee44 commit 42c9a45Copy full SHA for 42c9a45
src/util/simplify_expr.cpp
@@ -1404,15 +1404,17 @@ bool simplify_exprt::simplify_if(if_exprt &expr)
1404
1405
auto range_false = make_range(falsevalue_copy.operands());
1406
auto range_true = make_range(truevalue_copy.operands());
1407
+ auto new_expr = truevalue;
1408
+ new_expr.operands().clear();
1409
- for(auto &pair : range_true.zip(range_false))
1410
+ for(const auto &pair : range_true.zip(range_false))
1411
{
1412
if_exprt if_expr(cond_copy, pair.first, pair.second);
1413
simplify_if(if_expr);
- pair.first = std::move(if_expr);
1414
+ new_expr.operands().push_back(std::move(if_expr));
1415
}
1416
- expr.swap(truevalue_copy);
1417
+ expr.swap(new_expr);
1418
1419
return false;
1420
0 commit comments