Skip to content

Remove good_pointer, good_pointer_def #7386

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
merged 1 commit into from
Nov 28, 2022

Conversation

tautschnig
Copy link
Collaborator

good_pointer(ptr) is equivalent to __CPROVER_r_ok(ptr, sizeof(*ptr)).

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

@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

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

Coverage data is based on head (6d59ba9) compared to base (d67fbf9).
Patch coverage: 95.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7386   +/-   ##
========================================
  Coverage    78.37%   78.37%           
========================================
  Files         1647     1647           
  Lines       190327   190309   -18     
========================================
- Hits        149171   149158   -13     
+ Misses       41156    41151    -5     
Impacted Files Coverage Δ
src/ansi-c/expr2c.cpp 67.28% <ø> (ø)
src/goto-instrument/contracts/utils.h 100.00% <ø> (ø)
src/util/pointer_predicates.cpp 95.12% <ø> (+2.39%) ⬆️
src/util/pointer_predicates.h 100.00% <ø> (ø)
src/util/simplify_expr.cpp 85.36% <ø> (+0.04%) ⬆️
src/util/simplify_expr_class.h 90.47% <ø> (ø)
src/util/simplify_expr_pointer.cpp 86.58% <ø> (+0.75%) ⬆️
...o-instrument/contracts/instrument_spec_assigns.cpp 99.38% <80.00%> (ø)
src/ansi-c/c_typecheck_expr.cpp 75.60% <100.00%> (ø)
src/ansi-c/goto_check_c.cpp 91.60% <100.00%> (ø)
... and 5 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.

Copy link
Collaborator

@jimgrundy jimgrundy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup.

good_pointer(ptr) is equivalent to __CPROVER_r_ok(ptr, sizeof(*ptr)).
@feliperodri feliperodri added the aws Bugs or features of importance to AWS CBMC users label Nov 28, 2022
@remi-delmas-3000
Copy link
Collaborator

remi-delmas-3000 commented Nov 28, 2022

Where is r_ok_exprt{deref->pointer(), *size_of_expr_opt} translated into lower level expressions ?

Looking at the other PR #7395 where you added a r_or_w_ok_exprt::lower, it seems like the r_or_w_ok_exprt expansion is slightly different (checks for non-dead objects whereas good_pointer did not).

good_pointer was only used in the havocing of assigns clauses, the effects of this slight change might be very subtle.

@tautschnig
Copy link
Collaborator Author

Where is r_ok_exprt{deref->pointer(), *size_of_expr_opt} translated into lower level expressions ?

This is currently done in goto_check_ct, but #7395 will eventually remove this expansion.

Looking at the other PR #7395 where you added a r_or_w_ok_exprt::lower, it seems like the r_or_w_ok_exprt expansion is slightly different (checks for non-dead objects whereas good_pointer did not).

Correct.

good_pointer was only used in the havocing of assigns clauses, the effects of this slight change might be very subtle.

I'd argue it's an improvement: I don't know why good_pointer tracked deallocated, but not dead.

@tautschnig tautschnig merged commit b4033fb into diffblue:develop Nov 28, 2022
@tautschnig tautschnig deleted the cleanup/good-pointer branch November 28, 2022 20:25
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 cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants