-
Notifications
You must be signed in to change notification settings - Fork 273
implement boolbvt::get for enumeration types #8589
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
else if(type.id() == ID_enumeration) | ||
{ | ||
auto &elements = to_enumeration_type(type).elements(); | ||
mp_integer int_value = binary2integer(value, false); |
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 this be negative?
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.
No, binary2integer(..., false)
won't return a negative value.
mp_integer int_value = binary2integer(value, false); | ||
irep_idt element; | ||
if(int_value >= elements.size()) | ||
element = irep_idt{}; |
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.
❓ Where will we fall over when encountering this?
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.
Returning nil instead.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8589 +/- ##
===========================================
+ Coverage 78.71% 79.59% +0.88%
===========================================
Files 1732 1733 +1
Lines 199536 197389 -2147
Branches 18281 18166 -115
===========================================
+ Hits 157057 157111 +54
+ Misses 42479 40278 -2201 ☔ View full report in Codecov by Sentry. |
6d0a7aa
to
7451e83
Compare
This adds the missing implementation for getting values from models for enumeration types.
7451e83
to
b4f9748
Compare
This adds the missing implementation for getting values from models for enumeration types.