-
Notifications
You must be signed in to change notification settings - Fork 277
bv_get_rec: ensure all expressions are properly typed #7020
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
bv_get_rec: ensure all expressions are properly typed #7020
Conversation
The regression test included here failed as of 55fc192 for a member_exprt over an untyped nil_exprt was being constructed. While at it, get rid of the split-brain problem that passing the type separately from the expression had created.
Windows jobs temporarily failing for https://status.chocolatey.org/issues/2022-07-18-scheduled-maintenance-chocolatey-community-repository-and-website/. |
Codecov Report
@@ Coverage Diff @@
## develop #7020 +/- ##
========================================
Coverage 77.88% 77.88%
========================================
Files 1569 1569
Lines 180891 180892 +1
========================================
+ Hits 140878 140880 +2
+ Misses 40013 40012 -1
Continue to review full report at Codecov.
|
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.
Yes. Not sure why type
was being passed independently. Feels like probably like part of an older design, possibly for handling untyped access?
return bv_get_rec(expr, map_entry.literal_map, 0); | ||
else | ||
{ | ||
PRECONDITION(expr.type() == typet{}); |
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.
This gives me lots of "I don't think types are supposed to work like that" feelings. But I recognise that this is an improvement on what is there and not what the patch is addressing.
@@ -274,7 +269,9 @@ exprt boolbvt::bv_get_rec( | |||
|
|||
exprt boolbvt::bv_get(const bvt &bv, const typet &type) const |
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.
Can we get rid of this method?
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 unless we get rid of boolbvt::bv_get_cache
, which invokes this method.
The regression test included here failed as of 55fc192 for a
member_exprt over an untyped nil_exprt was being constructed. While at
it, get rid of the split-brain problem that passing the type separately
from the expression had created.