Skip to content

Conversion check: fix off-by-one error for float-to-unsigned #8157

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

We use less-than in the comparison, so make the bound one larger than the largest representable value (as we do in the other cases of float-to-signed/unsigned conversion checks).

Fixes: #8131

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

We use less-than in the comparison, so make the bound one larger than
the largest representable value (as we do in the other cases of
float-to-signed/unsigned conversion checks).

Fixes: diffblue#8131
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (69bb2b6) 79.09% compared to head (285893a) 79.09%.

Files Patch % Lines
src/ansi-c/goto_check_c.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8157      +/-   ##
===========================================
- Coverage    79.09%   79.09%   -0.01%     
===========================================
  Files         1695     1695              
  Lines       196583   196583              
===========================================
- Hits        155496   155493       -3     
- Misses       41087    41090       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kroening kroening enabled auto-merge January 11, 2024 16:43
@kroening kroening merged commit fd28cb2 into diffblue:develop Jan 11, 2024
@tautschnig tautschnig deleted the bugfixes/8131-float-overflow-off-by-one branch January 11, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong --conversion-check in cast from double to unsigned
4 participants