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

Fix pointer subtraction over integer constants #7398

Merged

Conversation

tautschnig
Copy link
Collaborator

633875b replaced the simplification of p - p to zero, which previously was the only code to correctly evaluate to zero expressions like (char *)n - (char *)n for some integer n when using the SAT back-end: 5b8028a removed such support from the propositional back-end, as bounds-checking over the null object would have deemed each of the pointers out-of-bounds.

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

633875b replaced the simplification of `p - p` to zero, which
previously was the only code to correctly evaluate to zero expressions
like `(char *)n - (char *)n` for some integer `n` when using the SAT
back-end: 5b8028a removed such support from the propositional
back-end, as bounds-checking over the null object would have deemed each
of the pointers out-of-bounds.
@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Base: 78.37% // Head: 78.38% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (087dabd) compared to base (941030e).
Patch coverage: 95.48% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7398      +/-   ##
===========================================
+ Coverage    78.37%   78.38%   +0.01%     
===========================================
  Files         1647     1647              
  Lines       190328   190384      +56     
===========================================
+ Hits        149172   149235      +63     
+ Misses       41156    41149       -7     
Impacted Files Coverage Δ
src/analyses/constant_propagator.h 82.35% <ø> (ø)
src/ansi-c/expr2c.cpp 67.66% <ø> (+0.42%) ⬆️
src/goto-instrument/havoc_loops.cpp 0.00% <0.00%> (ø)
src/util/pointer_predicates.cpp 95.12% <ø> (+2.39%) ⬆️
src/util/pointer_predicates.h 100.00% <ø> (ø)
src/util/simplify_expr_class.h 90.47% <ø> (ø)
src/util/simplify_expr_pointer.cpp 86.58% <ø> (+0.75%) ⬆️
src/analyses/constant_propagator.cpp 95.46% <88.88%> (ø)
src/util/expr_util.cpp 90.55% <95.83%> (+0.81%) ⬆️
src/ansi-c/c_typecheck_expr.cpp 75.60% <100.00%> (ø)
... and 25 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@feliperodri feliperodri added the aws Bugs or features of importance to AWS CBMC users label Dec 5, 2022
@tautschnig tautschnig merged commit 53e7bf4 into diffblue:develop Dec 5, 2022
@tautschnig tautschnig deleted the bugfixes/pointer-subtraction branch December 5, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users aws-high bugfix Kani Bugs or features of importance to Kani Rust Verifier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants