Skip to content

CONTRACTS: Moving check_frame_conditions to instrument_assigns_clauset. #6643

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

Conversation

remi-delmas-3000
Copy link
Collaborator

@remi-delmas-3000 remi-delmas-3000 commented Feb 4, 2022

To further encapsulate the the assigns clause checking algorithm in instrument_assigns_clause.cpp

  • the check_frame_conditions method and related functions have been moved from contracts.cpp and utils.cpp to instrument_assigns_clause.cpp.
  • the former track_static_locals method is now available in two different versions:
    • track_static_locals(dest) which tracks all local static variables touched directly or indirectly by the whole instrumented function (for function contracts)
    • track_static_locals_from_calls(begin, end, dest) which tracks all local static variables declared by functions that are called between the begin and end instructions (for loop contracts).

No functionality or performance impact expected.

  • 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-3000 remi-delmas-3000 added aws Bugs or features of importance to AWS CBMC users aws-high cleanup Code Contracts Function and loop contracts labels Feb 4, 2022
@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #6643 (75ea974) into develop (53c53f3) will increase coverage by 0.02%.
The diff coverage is 98.64%.

❗ Current head 75ea974 differs from pull request most recent head 222d266. Consider uploading reports for the commit 222d266 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6643      +/-   ##
===========================================
+ Coverage    76.79%   76.82%   +0.02%     
===========================================
  Files         1582     1582              
  Lines       182600   182767     +167     
===========================================
+ Hits        140231   140403     +172     
+ Misses       42369    42364       -5     
Impacted Files Coverage Δ
src/goto-instrument/contracts/contracts.h 100.00% <ø> (ø)
...oto-instrument/contracts/instrument_spec_assigns.h 100.00% <ø> (ø)
src/goto-instrument/contracts/utils.cpp 89.24% <ø> (+3.65%) ⬆️
src/goto-instrument/contracts/utils.h 100.00% <ø> (ø)
src/util/pointer_offset_size.cpp 92.52% <ø> (ø)
src/ansi-c/expr2c.cpp 66.24% <93.10%> (ø)
src/goto-instrument/contracts/contracts.cpp 89.22% <100.00%> (-1.53%) ⬇️
...o-instrument/contracts/instrument_spec_assigns.cpp 96.86% <100.00%> (+1.50%) ⬆️
src/ansi-c/c_typecheck_expr.cpp 76.45% <0.00%> (-0.15%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fd7a56...222d266. Read the comment docs.

@remi-delmas-3000 remi-delmas-3000 force-pushed the assigns-checking-self-contained branch 3 times, most recently from cc69ce1 to 550317b Compare February 15, 2022 18:04
Copy link
Collaborator

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

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

Only a few clarifications before approval.

@feliperodri
Copy link
Collaborator

* the `check_frame_conditions` method and related functions have been moved from `contracts.cpp` and `utils.cpp` to `instrument_assigns_clause.cpp`.

* the former `track_static_locals` method is now available in two different versions:
  
  * `track_static_locals_whole_function(dest)` which tracks all local static variables touched directly or indirectly by the whole instrumented function (for function contracts)
  * `track_static_locals_in_range(begin, end, dest)` which tracks all local static variables touched by function calls found between the begin and end instructions (for loop contracts).

@remi-delmas-3000 I'd create one commit for each one of these two main bullet points.

@remi-delmas-3000 remi-delmas-3000 force-pushed the assigns-checking-self-contained branch 2 times, most recently from 5277182 to 75ea974 Compare February 17, 2022 21:47
The `check_frame_conditions` method and related methods
have been moved from `contracts.cpp` and `utils.cpp`
to `instrument_assigns_clause.cpp`.

No functionality or performance impact expected.
@remi-delmas-3000 remi-delmas-3000 force-pushed the assigns-checking-self-contained branch from 75ea974 to 222d266 Compare February 17, 2022 21:52
@remi-delmas-3000
Copy link
Collaborator Author

I addressed all comments, removed dead code, and removed the changes to local static detection. I think it is stable now.

@tautschnig tautschnig merged commit 79c1637 into diffblue:develop Feb 18, 2022
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 cleanup Code Contracts Function and loop contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants