Skip to content

CONTRACTS: Allow NULL function pointers #7319

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

Conversation

remi-delmas-3000
Copy link
Collaborator

@remi-delmas-3000 remi-delmas-3000 commented Nov 10, 2022

Clauses requires_contract or ensures_contract
now accept NULL as third optional parameter
When provided, the meaning is: the function
pointer is either pointing to a function satisfying the given contract
or is NULL. When omitted, the function pointer cannot be NULL.

Drop support for these clauses in the old contract system.

Add user doc.

  • 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.
  • 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).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Claues requires_contract or ensures_contract
now accept NULL as third optional parameter
When provided, the meaning is: the function
pointer is either pointing to a function satisfying
the given contract or is NULL. When omitted,
the function pointer cannot be NULL.
@feliperodri feliperodri added aws Bugs or features of importance to AWS CBMC users Code Contracts Function and loop contracts labels Nov 10, 2022
@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

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

Coverage data is based on head (d8a8e54) compared to base (75cd6a8).
Patch coverage: 78.16% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7319   +/-   ##
========================================
  Coverage    78.28%   78.29%           
========================================
  Files         1642     1642           
  Lines       190004   190008    +4     
========================================
+ Hits        148744   148761   +17     
+ Misses       41260    41247   -13     
Impacted Files Coverage Δ
src/ansi-c/parser.y 81.09% <ø> (ø)
src/ansi-c/c_typecheck_code.cpp 78.88% <50.00%> (+1.51%) ⬆️
.../contracts/dynamic-frames/dfcc_wrapper_program.cpp 99.65% <97.61%> (+1.28%) ⬆️
src/ansi-c/c_expr.h 100.00% <100.00%> (ø)
src/goto-instrument/contracts/contracts.cpp 94.40% <100.00%> (-0.63%) ⬇️

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 changed the title CONTRACTS: allow NULL function pointers CONTRACTS: Allow NULL function pointers Nov 11, 2022
@remi-delmas-3000
Copy link
Collaborator Author

Replaced by two separate PRs: #7328 and #7327

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 Code Contracts Function and loop contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants