Skip to content
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

bitvector_typet: set width from mp_integer #8477

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

kroening
Copy link
Member

This adds C-style getter/setter methods to bitvector_typet for the width of the vector.

The setter takes an mp_integer, which checks that the width fits within std::size_t. This removes the burden of performing this check from the caller, and allows callers to avoid potential arithmetic overflows by using mp_integer.

  • Each commit message has a non-empty body, explaining why the change was made.
  • 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.

This adds C-style getter/setter methods to bitvector_typet for the width of
the vector.

The setter takes an mp_integer, which checks that the width fits within
std::size_t.  This removes the burden of performing this check from the
caller, and allows callers to avoid potential arithmetic overflows by using
mp_integer.
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.38%. Comparing base (4bd5c0a) to head (0079017).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/util/std_types.cpp 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8477      +/-   ##
===========================================
+ Coverage    78.23%   78.38%   +0.15%     
===========================================
  Files         1727     1727              
  Lines       189050   188685     -365     
  Branches     18467    18475       +8     
===========================================
+ Hits        147898   147900       +2     
+ Misses       41152    40785     -367     

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

@kroening kroening marked this pull request as ready for review September 29, 2024 15:02
@kroening kroening merged commit 83922b2 into develop Sep 29, 2024
40 of 41 checks passed
@kroening kroening deleted the bitvector_width_biginteger branch September 29, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants