Skip to content

Commit 42c9a45

Browse files
committed
fx
1 parent 6afee44 commit 42c9a45

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/util/simplify_expr.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,15 +1404,17 @@ bool simplify_exprt::simplify_if(if_exprt &expr)
14041404

14051405
auto range_false = make_range(falsevalue_copy.operands());
14061406
auto range_true = make_range(truevalue_copy.operands());
1407+
auto new_expr = truevalue;
1408+
new_expr.operands().clear();
14071409

1408-
for(auto &pair : range_true.zip(range_false))
1410+
for(const auto &pair : range_true.zip(range_false))
14091411
{
14101412
if_exprt if_expr(cond_copy, pair.first, pair.second);
14111413
simplify_if(if_expr);
1412-
pair.first = std::move(if_expr);
1414+
new_expr.operands().push_back(std::move(if_expr));
14131415
}
14141416

1415-
expr.swap(truevalue_copy);
1417+
expr.swap(new_expr);
14161418

14171419
return false;
14181420
}

0 commit comments

Comments
 (0)