Skip to content

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

Merged

Conversation

tautschnig
Copy link
Collaborator

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.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig self-assigned this Mar 25, 2022
@tautschnig tautschnig changed the title goto_rw/range_spect: gracefully handle arbitrarily large ranges goto_rw/range_spect: gracefully handle arbitrarily large ranges [depends-on: #6753] Mar 25, 2022
@tautschnig tautschnig changed the title goto_rw/range_spect: gracefully handle arbitrarily large ranges [depends-on: #6753] goto_rw/range_spect: gracefully handle arbitrarily large ranges May 10, 2022
tautschnig added a commit that referenced this pull request May 10, 2022
goto_rw/range_spect: wrap in a class instead of using just a typedef [blocks: #6749, #6768]
@tautschnig tautschnig force-pushed the bugfixes/goto_rw-large-object branch from 6cdf2bd to 3835a7b Compare May 10, 2022 19:41
@tautschnig tautschnig marked this pull request as ready for review May 10, 2022 19:41
@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #6768 (3835a7b) into develop (5d74a03) will increase coverage by 0.00%.
The diff coverage is 80.00%.

❗ Current head 3835a7b differs from pull request most recent head f2f218e. Consider uploading reports for the commit f2f218e to get more accurate results

@@           Coverage Diff            @@
##           develop    #6768   +/-   ##
========================================
  Coverage    77.78%   77.79%           
========================================
  Files         1567     1567           
  Lines       179701   179709    +8     
========================================
+ Hits        139789   139799   +10     
+ Misses       39912    39910    -2     
Impacted Files Coverage Δ
src/analyses/goto_rw.h 74.50% <80.00%> (-0.50%) ⬇️
src/goto-programs/goto_program.h 90.25% <0.00%> (-0.46%) ⬇️
src/util/graph.h 96.83% <0.00%> (-0.32%) ⬇️
src/ansi-c/ansi_c_language.cpp 96.42% <0.00%> (-0.09%) ⬇️
src/analyses/goto_rw.cpp 64.36% <0.00%> (ø)
src/ansi-c/ansi_c_language.h 75.00% <0.00%> (ø)
src/goto-programs/remove_skip.cpp 100.00% <0.00%> (ø)
src/goto-programs/rewrite_union.cpp 100.00% <0.00%> (ø)
src/goto-programs/link_goto_model.cpp 85.50% <0.00%> (ø)
src/goto-programs/show_properties.cpp 64.42% <0.00%> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca064fc...f2f218e. Read the comment docs.

@@ -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())
Copy link
Member

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.

Copy link
Collaborator Author

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.)

@peterschrammel peterschrammel removed their assignment May 17, 2022
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.
@tautschnig tautschnig force-pushed the bugfixes/goto_rw-large-object branch from 3835a7b to f2f218e Compare May 17, 2022 12:16
@tautschnig tautschnig merged commit 8a9ab0c into diffblue:develop May 17, 2022
@tautschnig tautschnig deleted the bugfixes/goto_rw-large-object branch May 17, 2022 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants