-
Notifications
You must be signed in to change notification settings - Fork 274
Fix value-set make_member function #3570
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
Fix value-set make_member function #3570
Conversation
26626ad
to
142cafe
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: 142cafe).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/94978728
142cafe
to
9d6260f
Compare
|
||
return std::move(member_expr); | ||
return member_expr; |
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 believe this should stay as return std::move(member_expr);
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.
Not so! It's type now matches the return type, so I leave it out and enable RVO. I hope a forthcoming version of C++ renders this distinction unnecessary...
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.
Oops, sorry, I ignored that you had used exprt member_expr ...
.
…r casts This signals that the cast is cleaner than a general byte-extract a little more clearly
Previously this would simplify ((struct A)x).y into x.y regardless of whether the two structures both have a member y, or whether it is colocated in the two types. Now that the simplifier can soundly simplify such an expression we should just use that instead.
Now that value-set soundly simplifies member-of-cast-of-struct, this test works as expected. This also improves the specificity of the two tests in this directory. This is disabled under SMT2 for the same reason as the existing test.desc -- it involves a struct-to-struct cast, which SMT2's `convert_typecast` doesn't handle yet.
9d6260f
to
8d88c97
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: 8d88c97).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/94987938
Fixes #3569;
depends on #3562, which is the first commit in this PR.Previously
value_sett
would simplify ((struct A)x).y into x.y regardless of whether the two structures both have a member y, or whether it is colocated in the two types. Improve the simplifier slightly to tackle this case, then use it rather than implement custom logic invalue_sett
.