-
Notifications
You must be signed in to change notification settings - Fork 273
CONTRACTS: Dynamic frame condition checking #6887
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
Closed
remi-delmas-3000
wants to merge
20
commits into
diffblue:develop
from
remi-delmas-3000:contracts-dfcc
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ad38602
CONTRACTS: Front-end extensions for assigns clauses and frees clauses.
3b159ae
CONTRACTS: Front-end: frees clause improvements
8895dbe
CONTRACTS: Front-end extension: add `__CPROVER_is_freshr`
3aec0ee
CONTRACTS: Add class `dfcc_utilst` for DFCC utility methods.
c2b085d
CONTRACTS: Add library functions for dynamic frames
9bd1bdd
CONTRACTS: Add `dfcc_contract_modet` and `dfcc_contract_handlert`.
a3af206
CONTRACTS: Map built-in predicate calls to their contract implem.
1a354f7
CONTRACTS: Add class `goto_program_cfg_infot`.
b202f92
CONTRACTS: Add class `dfcc_instrumentt` to instrument goto
7f9910c
CONTRACTS: Adds the `dfcc_spec_functionst` class.
242fc9b
CONTRACTS: Add the `dfcc_dsl_contract_functionst` class.
3ec82b7
dfcc_dsl_contract_functionst fixes
408e529
CONTRACTS: Add the `dfcc_dsl_wrapper_programt` class.
b6c770a
CONTRACTS: Add the `dfcc_dsl_contract_handlert` class.
f99526a
CONTRACTS: Add the `dfcc_swap_and_wrapt class`.
cd537ef
dfcc_swap_and_wrap fixes
a624d48
CONTRACTS: Add class `dfcct`, the main class for
f59b93c
CONTRACTS: add the `--dfcc` switch to the goto-instrument CLI interface
24ba3bd
CONTACTS: update regression test suite for DFCC
29ef0b0
developer doc for contracts with dynamic frames
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
CORE | ||
main.c | ||
--enforce-contract foo | ||
--dfcc main --enforce-contract foo | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
-- | ||
Checks that assigns clause checking explicitly checks assignments to locally | ||
Checks that assigns clause checking explicitly checks assignments to locally | ||
declared symbols with composite types, when they are dirty. | ||
Out of bounds accesses to locally declared arrays, structs, etc. | ||
Out of bounds accesses to locally declared arrays, structs, etc. | ||
will be detected by assigns clause checking. |
2 changes: 1 addition & 1 deletion
2
regression/contracts/assigns-replace-ignored-return-value/test.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,14 @@ struct st | |
int c; | ||
}; | ||
|
||
void foo(struct st *s) | ||
void foo(struct st *s, struct st *ss) | ||
// clang-format off | ||
__CPROVER_requires(__CPROVER_is_fresh(s, sizeof(*s))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be consistent, we may also want to require __CPROVER_requires(__CPROVER_is_fresh(ss, sizeof(*ss))). |
||
__CPROVER_assigns(__CPROVER_object_slice(s->arr1, 5)) | ||
__CPROVER_assigns(__CPROVER_object_from(s->arr2 + 5)) | ||
__CPROVER_assigns( | ||
__CPROVER_object_upto(s->arr1, 5); | ||
__CPROVER_object_from(s->arr2 + 5); | ||
__CPROVER_whole_object(ss); | ||
) | ||
// clang-format on | ||
{ | ||
// PASS | ||
|
@@ -41,13 +44,24 @@ void foo(struct st *s) | |
s->arr2[7] = 0; | ||
s->arr2[8] = 0; | ||
s->arr2[9] = 0; | ||
|
||
// PASS | ||
ss->a = 0; | ||
ss->arr1[0] = 0; | ||
ss->arr1[7] = 0; | ||
ss->arr1[9] = 0; | ||
ss->b = 0; | ||
ss->arr2[6] = 0; | ||
ss->arr2[8] = 0; | ||
ss->c = 0; | ||
} | ||
|
||
int main() | ||
{ | ||
struct st s; | ||
struct st ss; | ||
|
||
foo(&s); | ||
foo(&s, &ss); | ||
|
||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really like this to be named "__CPROVER_object_whole" for consistency with "__CPROVER_object_from" and "__CPROVER_object_slice"