-
Notifications
You must be signed in to change notification settings - Fork 273
Do not generate nil_exprt in bv_get #4197
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
Conversation
|
||
std::size_t sub_width=boolbv_width(subtype); | ||
const member_exprt member(expr, c.get_name(), subtype); | ||
op.push_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.
Doesn't this then produce a member of nil?
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 was me being lazy, which I shouldn't have been. Now passing a proper index_exprt
.
@@ -168,9 +168,11 @@ exprt boolbvt::bv_get_rec( | |||
|
|||
const typet &subtype = components[component_nr].type(); | |||
|
|||
const member_exprt member( | |||
expr, components[component_nr].get_name(), subtype); | |||
return union_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.
same here?
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.
As above, the nil_exprt
is now an index_exprt
and there can't be a nil_exprt
reaching this point.
@@ -262,14 +268,14 @@ exprt boolbvt::bv_get_rec( | |||
} | |||
} | |||
|
|||
return nil_exprt(); | |||
UNREACHABLE; |
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.
There should be a PRECONDITION in the if(...) above on the type, or a failure here will be hard to debug.
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 have borrowed a bit from #2548. (Edit: sorry, that doesn't actually help here, I've added the appropriate PRECONDITION
instead.)
45edfa9
to
e9ffb73
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: e9ffb73).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106406254
e9ffb73
to
14253f3
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: 14253f3).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106420870
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.
It seems like only the last commit is actually connected to the title of the PR.
Ah, sorry, I should have said so: the first two are from #4372, which I've marked this one as dependent-on. |
14253f3
to
7da0d6f
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: 7da0d6f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106870338
2319ead
to
69c8b0d
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: 69c8b0d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106929748
We have all the information available, and should thus always generate concrete values.
69c8b0d
to
57874c4
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: 57874c4).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106944413
We have all the information available, and should thus always generate concrete
values.
This is an attempt to address what has been discussed in #4153, but completely missing automated tests (I've done some local hacks on my L1-renaming branch). @thk123 would you be able to take a look and possibly assist with tests?