Skip to content

CONTRACTS: Allow NULL function pointer contracts #7327

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 11, 2022

depends on #7328

Adds a third optional NULL parameter to the __CPROVER_requires_contract and __CPROVER_ensures_contract clauses. When specified, the meaning is that the function pointer in question can be either pointing to a function
satisfying the contract or be NULL.

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

Remi Delmas added 3 commits November 11, 2022 22:21
Adds a thrid optional NULL parameter to requires_contract
and ensures_contract clauses, allows a pointer to a function
to either satisfy a given contract or to be NULL.
@remi-delmas-3000 remi-delmas-3000 force-pushed the dfcc-function-pointers-contracts-allow-null branch from 77592f7 to d80ce8e Compare November 11, 2022 22:21
@remi-delmas-3000 remi-delmas-3000 self-assigned this Nov 11, 2022
@remi-delmas-3000 remi-delmas-3000 added dependent - do not merge aws Bugs or features of importance to AWS CBMC users Code Contracts Function and loop contracts labels Nov 11, 2022
@feliperodri feliperodri changed the title CONTRACTS: allow null function pointer contracts CONTRACTS: Allow NULL function pointer contracts Nov 11, 2022
@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

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

Coverage data is based on head (77592f7) compared to base (a295651).
Patch coverage: 79.28% of modified lines in pull request are covered.

❗ Current head 77592f7 differs from pull request most recent head d80ce8e. Consider uploading reports for the commit d80ce8e to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7327      +/-   ##
===========================================
+ Coverage    78.28%   78.29%   +0.01%     
===========================================
  Files         1642     1642              
  Lines       190004   190015      +11     
===========================================
+ Hits        148744   148773      +29     
+ Misses       41260    41242      -18     
Impacted Files Coverage Δ
src/ansi-c/parser.y 81.09% <ø> (ø)
src/goto-instrument/contracts/contracts.h 100.00% <ø> (ø)
src/goto-programs/graphml_witness.cpp 52.94% <0.00%> (-0.15%) ⬇️
src/goto-programs/interpreter.cpp 52.38% <0.00%> (+0.17%) ⬆️
src/ansi-c/c_typecheck_code.cpp 78.88% <50.00%> (+1.51%) ⬆️
src/util/expr_initializer.cpp 85.10% <80.00%> (+1.77%) ⬆️
jbmc/src/java_bytecode/expr2java.cpp 86.25% <93.75%> (ø)
.../contracts/dynamic-frames/dfcc_wrapper_program.cpp 99.65% <97.61%> (+1.28%) ⬆️
src/ansi-c/c_expr.h 100.00% <100.00%> (ø)
src/ansi-c/c_typecheck_initializer.cpp 76.57% <100.00%> (+0.04%) ⬆️
... and 9 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.

@tautschnig
Copy link
Collaborator

#7328 is now merged, but various CI jobs appear to be failing.

@remi-delmas-3000
Copy link
Collaborator Author

#7328 is now merged, but various CI jobs appear to be failing.

this PR needs a rebase. I'm exploring an alternative format for these clauses so I'll leave this as-is for now

@remi-delmas-3000
Copy link
Collaborator Author

will be superseded by a new PR

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 dependent - do not merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants