-
Notifications
You must be signed in to change notification settings - Fork 274
Construct equal_exprt in a non-deprecated way #3776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Construct equal_exprt in a non-deprecated way #3776
Conversation
d9ce402
to
49b4c89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 49b4c89).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97157310
equal_exprt equality_expr; | ||
equality_expr.operands()=expr.arguments(); | ||
equal_exprt equality_expr( | ||
expr.arguments().front(), expr.arguments().back()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this has two elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's check 7 lines earlier so this should be ok.
equal_exprt equality; | ||
equality.lhs() = expr.offset(); // index operand | ||
// index operand | ||
equal_exprt equality(expr.offset(), exprt()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment that rhs
will be set below.
@@ -170,8 +170,8 @@ bvt boolbvt::convert_byte_extract(const byte_extract_exprt &expr) | |||
} | |||
else | |||
{ | |||
equal_exprt equality; | |||
equality.lhs() = expr.offset(); // index operand | |||
// index operand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment that rhs
will be set below.
equal_exprt index_equality; | ||
index_equality.lhs()=index; // index operand | ||
// index operand | ||
equal_exprt index_equality(index, exprt()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment that rhs
will be set below.
equal_exprt index_equality; | ||
index_equality.lhs()=index; // index operand | ||
// index operand | ||
equal_exprt index_equality(index, exprt()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether it wouldn't be better to construct the equality on conversion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now done so, for all the cases that you pointed out.
49b4c89
to
a8a97fe
Compare
The default constructor is deprecated.
a8a97fe
to
5f0367c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 5f0367c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97280227
The default constructor is deprecated.