-
Notifications
You must be signed in to change notification settings - Fork 273
goto_rw/range_spect: gracefully handle arbitrarily large ranges #6768
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
goto_rw/range_spect: gracefully handle arbitrarily large ranges #6768
Conversation
6cdf2bd
to
3835a7b
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6768 +/- ##
========================================
Coverage 77.78% 77.79%
========================================
Files 1567 1567
Lines 179701 179709 +8
========================================
+ Hits 139789 139799 +10
+ Misses 39912 39910 -2
Continue to review full report at Codecov.
|
@@ -78,10 +78,17 @@ class range_spect | |||
|
|||
static range_spect to_range_spect(const mp_integer &size) | |||
{ | |||
PRECONDITION(size.is_long()); | |||
if(!size.is_long()) |
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.
❓ When wouldn't it be a long? A comment would help.
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.
Comment added, including an example. (A signed long, for example, isn't sufficient to capture a maximum size_t value.)
When the value of an mp_integer doesn't fit into a range_spect::value_type we can safely fall back to using "unknown" instead, which is a safe over-approximation.
3835a7b
to
f2f218e
Compare
When the value of an mp_integer doesn't fit into a range_spect::value_type we can safely fall back to using "unknown" instead, which is a safe over-approximation.