Skip to content

Commit 40513b3

Browse files
author
Daniel Kroening
authored
Merge pull request #3789 from tautschnig/deprecation-binary_relation_exprt
Construct binary_relation_exprt in a non-deprecated way
2 parents abb78df + 663b51a commit 40513b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/util/simplify_expr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ bool simplify_exprt::simplify_typecast(exprt &expr)
218218
if(expr_type.id()==ID_bool)
219219
{
220220
// rewrite (bool)x to x!=0
221-
binary_relation_exprt inequality;
222-
inequality.id(op_type.id()==ID_floatbv?ID_ieee_float_notequal:ID_notequal);
221+
binary_relation_exprt inequality(
222+
expr.op0(),
223+
op_type.id() == ID_floatbv ? ID_ieee_float_notequal : ID_notequal,
224+
from_integer(0, op_type));
223225
inequality.add_source_location()=expr.source_location();
224-
inequality.lhs()=expr.op0();
225-
inequality.rhs()=from_integer(0, op_type);
226226
CHECK_RETURN(inequality.rhs().is_not_nil());
227227
simplify_node(inequality);
228228
expr.swap(inequality);

0 commit comments

Comments
 (0)