Skip to content

Commit 55a1662

Browse files
committed
substitute_symbols now preserves comments in binding expressions
1 parent 54aca0a commit 55a1662

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/util/substitute_symbols.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ static optionalt<exprt> substitute_symbols_rec(
3939
auto op_result =
4040
substitute_symbols_rec(new_substitutions, binding_expr.where());
4141
if(op_result.has_value())
42-
return binding_exprt(
43-
src.id(),
44-
binding_expr.variables(),
45-
op_result.value(),
46-
binding_expr.type());
42+
{
43+
auto new_binding_expr = binding_expr; // copy
44+
new_binding_expr.where() = std::move(op_result.value());
45+
return std::move(new_binding_expr);
46+
}
4747
else
4848
return {};
4949
}

0 commit comments

Comments
 (0)