Commit 2a32be7
committed
Require explicit contract for --replace-call-with-contract
Change --replace-call-with-contract to produce a hard error instead of a
warning when used with functions lacking explicit contracts. This
change addresses a soundness issue where CBMC would previously assume a
trivial contract automatically.
Users that really need a trivial contract with no constraints should use
````c
int my_function(int x)
__CPROVER_requires(1)
__CPROVER_ensures(1)
{
return x + 1;
}
````
Fixes: #87281 parent 0985044 commit 2a32be7
File tree
29 files changed
+85
-66
lines changed- regression/contracts-dfcc
- assigns-local-composite
- assigns_enforce_15
- assigns_enforce_17
- assigns_enforce_20
- assigns_enforce_arrays_01
- assigns_enforce_arrays_03
- assigns_enforce_malloc_01
- assigns_enforce_malloc_02
- assigns_enforce_malloc_03
- assigns_enforce_statics
- assigns_enforce_structs_01
- assigns_enforce_structs_02
- assigns_enforce_structs_03
- assigns_enforce_subfunction_calls
- assigns_replace_08
- assigns_type_checking_valid_cases
- function-contract-mapping
- havoc-conditional-target
- loop_assigns_function_paramters
- loop_assigns_target_base_idents
- memory-predicates-user-defined-ensures-replace
- replace-call-no-contract
- ternary-lhs-loop-contract
- test_is_fresh_weak_assert_requires_fail
- test_is_fresh_weak_assert_requires_pass
- src/goto-instrument/contracts
- doc/user
- dynamic-frames
29 files changed
+85
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments