File tree 16 files changed +430
-410
lines changed
regression/contracts-dfcc
assigns_enforce_malloc_02
assigns_replace_havoc_dependent_targets_fail
assigns_replace_havoc_dependent_targets_pass
function-calls-03-direct-recursion
function-pointer-contracts-enforce
test_is_fresh_replace_ensures_pass
src/goto-instrument/contracts/dynamic-frames
16 files changed +430
-410
lines changed Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
3
--dfcc main --enforce-contract foo --replace-call-with-contract quz
4
- ^\[bar.assigns.\d+\] line \d+ Check that \*y is assignable: SUCCESS$
5
- ^\[quz.assigns.\d+\] Check that the assigns clause of contract::quz is included in the caller's assigns clause: FAILURE$
4
+ ^\[bar.assigns.\d+\].*Check that \*y is assignable: SUCCESS$
6
5
^VERIFICATION FAILED$
7
6
^EXIT=10$
8
7
^SIGNAL=0$
Original file line number Diff line number Diff line change 2
2
main.c
3
3
--dfcc main --enforce-contract f
4
4
main.c function f
5
- ^\[f.postcondition.\d+\] line 3 Check ensures clause of contract contract::f for function f: SUCCESS$
6
5
^\[f.assigns.\d+\] line 7 Check that ptr is assignable: SUCCESS$
7
6
^\[f.assigns.\d+\] line 12 Check that \*ptr is assignable: SUCCESS$
8
7
^\[f.assigns.\d+\] line 13 Check that n is assignable: SUCCESS$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
3
--dfcc main --enforce-contract foo --replace-call-with-contract bar _ --pointer-primitive-check
4
- ^\[bar.assigns.\d+\] Check that the assigns clause of contract::bar is included in the caller's assigns clause: FAILURE$
4
+ ^\[bar.assigns.\d+\].* Check that the assigns clause of contract::bar is included in the caller's assigns clause: FAILURE$
5
5
^VERIFICATION FAILED$
6
6
^EXIT=10$
7
7
^SIGNAL=0$
Original file line number Diff line number Diff line change 3
3
--dfcc main --replace-call-with-contract bar --enforce-contract foo
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
- ^\[bar.assigns.\d+\] Check that the assigns clause of contract::bar is included in the caller's assigns clause: SUCCESS$
6
+ ^\[bar.assigns.\d+\].* Check that the assigns clause of contract::bar is included in the caller's assigns clause: SUCCESS$
7
7
^VERIFICATION SUCCESSFUL$
8
8
--
9
9
--
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main_replace.c
3
3
--dfcc main --replace-call-with-contract resize_vec --enforce-contract resize_vec_incr10 _ --signed-overflow-check --unsigned-overflow-check --pointer-overflow-check
4
- ^\[resize_vec.assigns.\d+\] Check that the assigns clause of contract::resize_vec is included in the caller's assigns clause: FAILURE$
5
- ^\[resize_vec.frees.\d+\] Check that the frees clause of contract::resize_vec is included in the caller's frees clause: FAILURE$
4
+ ^\[resize_vec.assigns.\d+\].* Check that the assigns clause of contract::resize_vec is included in the caller's assigns clause: FAILURE$
5
+ ^\[resize_vec.frees.\d+\].* Check that the frees clause of contract::resize_vec is included in the caller's frees clause: FAILURE$
6
6
^VERIFICATION FAILED$
7
7
^EXIT=10$
8
8
^SIGNAL=0$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main_replace.c
3
3
--dfcc main --replace-call-with-contract resize_vec --enforce-contract resize_vec_incr10 _ --signed-overflow-check --unsigned-overflow-check --pointer-overflow-check
4
- ^\[resize_vec.assigns.\d+\] Check that the assigns clause of contract::resize_vec is included in the caller's assigns clause: SUCCESS$
5
- ^\[resize_vec.frees.\d+\] Check that the frees clause of contract::resize_vec is included in the caller's frees clause: SUCCESS$
4
+ ^\[resize_vec.assigns.\d+\].* Check that the assigns clause of contract::resize_vec is included in the caller's assigns clause: SUCCESS$
5
+ ^\[resize_vec.frees.\d+\].* Check that the frees clause of contract::resize_vec is included in the caller's frees clause: SUCCESS$
6
6
^VERIFICATION SUCCESSFUL$
7
7
^EXIT=0$
8
8
^SIGNAL=0$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
3
--dfcc main --enforce-contract-rec f
4
- ^\[f.postcondition.\d+\] .* Check ensures clause of contract contract::f for function f: SUCCESS$
5
- ^\[f.precondition.\d+\] .* Check requires clause of contract contract::f for function f: SUCCESS$
6
- ^\[f.assigns.\d+\] Check that the assigns clause of contract::f is included in the caller's assigns clause: SUCCESS$
7
- ^\[f.frees.\d+\] Check that the frees clause of contract::f is included in the caller's frees clause: SUCCESS$
4
+ ^\[f.postcondition.\d+\].* Check ensures clause of contract contract::f for function f: SUCCESS$
5
+ ^\[f.precondition.\d+\].* Check requires clause of contract contract::f for function f: SUCCESS$
6
+ ^\[f.assigns.\d+\].* Check that the assigns clause of contract::f is included in the caller's assigns clause: SUCCESS$
7
+ ^\[f.frees.\d+\].* Check that the frees clause of contract::f is included in the caller's frees clause: SUCCESS$
8
8
^EXIT=0$
9
9
^SIGNAL=0$
10
10
^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
3
--restrict-function-pointer foo.function_pointer_call.1/arr_fun_contract --dfcc main --enforce-contract foo --replace-call-with-contract bar --replace-call-with-contract arr_fun_contract
4
- ^\[arr_fun_contract.assigns.\d+\] Check that the assigns clause of contract::arr_fun_contract is included in the caller's assigns clause: SUCCESS$
5
- ^\[arr_fun_contract.frees.\d+\] Check that the frees clause of contract::arr_fun_contract is included in the caller's frees clause: SUCCESS$
6
- ^\[arr_fun_contract.precondition.\d+\] line 14 Check requires clause of contract contract::arr_fun_contract for function arr_fun_contract: SUCCESS$
4
+ ^\[arr_fun_contract.assigns.\d+\].* Check that the assigns clause of contract::arr_fun_contract is included in the caller's assigns clause: SUCCESS$
5
+ ^\[arr_fun_contract.frees.\d+\].* Check that the frees clause of contract::arr_fun_contract is included in the caller's frees clause: SUCCESS$
6
+ ^\[arr_fun_contract.precondition.\d+\].* Check requires clause of contract contract::arr_fun_contract for function arr_fun_contract: SUCCESS$
7
7
^EXIT=0$
8
8
^SIGNAL=0$
9
9
^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
3
--restrict-function-pointer foo.function_pointer_call.1/arr_fun_contract --dfcc main --enforce-contract foo --replace-call-with-contract bar
4
- ^\[arr_fun_contract.assigns.\d+\] Check that the assigns clause of contract::arr_fun_contract is included in the caller's assigns clause: SUCCESS$
5
- ^\[arr_fun_contract.frees.\d+\] Check that the frees clause of contract::arr_fun_contract is included in the caller's frees clause: SUCCESS$
6
- ^\[arr_fun_contract.precondition.\d+\] line 14 Check requires clause of contract contract::arr_fun_contract for function arr_fun_contract: SUCCESS$
4
+ ^\[arr_fun_contract.assigns.\d+\].* Check that the assigns clause of contract::arr_fun_contract is included in the caller's assigns clause: SUCCESS$
5
+ ^\[arr_fun_contract.frees.\d+\].* Check that the frees clause of contract::arr_fun_contract is included in the caller's frees clause: SUCCESS$
6
+ ^\[arr_fun_contract.precondition.\d+\].* Check requires clause of contract contract::arr_fun_contract for function arr_fun_contract: SUCCESS$
7
7
^EXIT=0$
8
8
^SIGNAL=0$
9
9
^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
3
--dfcc main --enforce-contract foo
4
- ^\[foo.postcondition.\d+\].*Check ensures clause of contract contract::foo for function foo: SUCCESS$
5
4
^\[foo.assigns.\d+\].*Check that i is assignable: SUCCESS$
6
5
^\[foo.assigns.\d+\].*Check that arr\[\(.*\)i\] is assignable: SUCCESS$
7
6
^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
3
--dfcc main --replace-call-with-contract foo
4
- ^\[foo.precondition.\d+\].*Check requires clause of contract contract::foo for function foo: SUCCESS$
5
4
^\[main.assertion.\d+\].*out1 is rw_ok: SUCCESS$
6
5
^\[main.assertion.\d+\].*out2 is rw_ok: SUCCESS$
7
6
^\[main.assertion.\d+\].*out1 and out2 are not aliased: SUCCESS$
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ class function_pointer_obeys_contract_exprt;
61
61
// /
62
62
// / Translation results are cached so it is safe to call
63
63
// / `get_contract_functions` several times.
64
+ // /
65
+ // / This class also implements the \ref dfcc_contract_handlert interface
66
+ // / and allows to generate instructions modelling contract checking and
67
+ // / contract replacement.
64
68
class dfcc_dsl_contract_handlert : public dfcc_contract_handlert
65
69
{
66
70
public:
You can’t perform that action at this time.
0 commit comments