Skip to content

Commit faaf50e

Browse files
authored
Merge pull request #6376 from tautschnig/restrictions
Use remove-function-pointers code for restricted function pointers
2 parents d460e1c + d825d04 commit faaf50e

File tree

27 files changed

+202
-157
lines changed

27 files changed

+202
-157
lines changed

regression/cbmc/Function_Pointer_Init_No_Candidate/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE
22
main.c
33
--function foo --pointer-check
44
^\[foo.assertion.\d+\] line \d+ assertion other_function\(4\) > 5: SUCCESS$
5-
^\[foo.pointer_dereference.\d+\] line \d+ invalid function pointer: FAILURE$
5+
^\[foo.pointer_dereference.\d+\] line \d+ no candidates for dereferenced function pointer: FAILURE$
66
^EXIT=10$
77
^SIGNAL=0$
88
^VERIFICATION FAILED

regression/goto-analyzer/approx-const-fp-array-variable-struct-const-fp-with-zero/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ main.c
55
^\s*IF .*::fp = address_of\(f2\) THEN GOTO [0-9]$
66
^\s*IF .*::fp = address_of\(f3\) THEN GOTO [0-9]$
77
^\s*IF .*::fp = address_of\(f4\) THEN GOTO [0-9]$
8-
^\s*ASSERT false // invalid function pointer$
8+
^\s*ASSERT false // dereferenced function pointer must be one of \[f[2-4], f[2-4], f[2-4]\]$
99
^EXIT=0$
1010
^SIGNAL=0$
1111
--

regression/goto-analyzer/no-match-array-literal-const-fp-null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE
22
main.c
33
--show-goto-functions --pointer-check
44
^Removal of function pointers and virtual functions$
5-
^\s*ASSERT false // invalid function pointer$
5+
^\s*ASSERT false // no candidates for dereferenced function pointer
66
^EXIT=0$
77
^SIGNAL=0$
88
function func: replacing function pointer by 0 possible targets

regression/goto-analyzer/no-match-const-fp-const-fp-null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE
22
main.c
33
--show-goto-functions --pointer-check
44
^Removal of function pointers and virtual functions$
5-
^\s*ASSERT false // invalid function pointer$
5+
^\s*ASSERT false // no candidates for dereferenced function pointer
66
^EXIT=0$
77
^SIGNAL=0$
88
replacing function pointer by 0 possible targets

regression/goto-analyzer/no-match-const-fp-const-pointer-const-struct-const-fp-null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE
22
main.c
33
--show-goto-functions --pointer-check
44
^Removal of function pointers and virtual functions$
5-
^\s*ASSERT false // invalid function pointer$
5+
^\s*ASSERT false // dereferenced function pointer must be one of \[(f[1-9], ){8}f[1-9]\]$
66
replacing function pointer by 9 possible targets
77
^EXIT=0$
88
^SIGNAL=0$

regression/goto-analyzer/no-match-const-fp-dereference-const-pointer-null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE
22
main.c
33
--show-goto-functions --pointer-check
44
^Removal of function pointers and virtual functions$
5-
^\s*ASSERT false // invalid function pointer$
5+
^\s*ASSERT false // dereferenced function pointer must be one of \[(f[1-9], ){8}f[1-9]\]$
66
replacing function pointer by 9 possible targets
77
^EXIT=0$
88
^SIGNAL=0$

regression/goto-analyzer/no-match-const-fp-null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE
22
main.c
33
--show-goto-functions --pointer-check
44
^Removal of function pointers and virtual functions$
5-
^\s*ASSERT false // invalid function pointer$
5+
^\s*ASSERT false // no candidates for dereferenced function pointer
66
function func: replacing function pointer by 0 possible targets
77
^EXIT=0$
88
^SIGNAL=0$

regression/goto-analyzer/no-match-const-struct-non-const-fp-null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE
22
main.c
33
--show-goto-functions --pointer-check
44
^Removal of function pointers and virtual functions$
5-
^\s*ASSERT false // invalid function pointer$
5+
^\s*ASSERT false // no candidates for dereferenced function pointer
66
^EXIT=0$
77
^SIGNAL=0$
88
replacing function pointer by 0 possible targets

regression/goto-instrument/restrict-function-pointer-by-name-global/test.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
CORE
22
test.c
33
--restrict-function-pointer-by-name fp/f,g
4-
\[main\.assertion\.1\] line \d+ dereferenced function pointer at main\.function_pointer_call\.1 must be one of \[(f, g)|(g, f)\]: SUCCESS
4+
\[main\.pointer_dereference\.1\] line \d+ dereferenced function pointer must be one of \[(f, g)|(g, f)\]: SUCCESS
5+
\[main.assertion.1\] line \d+ assertion: FAILURE
56
\[main.assertion.2\] line \d+ assertion: FAILURE
6-
\[main.assertion.3\] line \d+ assertion: FAILURE
7-
\[main.assertion.4\] line \d+ assertion: SUCCESS
7+
\[main.assertion.3\] line \d+ assertion: SUCCESS
88
f\(\)
99
g\(\)
1010
^EXIT=10$

regression/goto-instrument/restrict-function-pointer-by-name-local/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
test.c
33
--restrict-function-pointer-by-name main::1::fp/f
4-
\[main\.assertion\.1\] line \d+ dereferenced function pointer at main\.function_pointer_call\.1 must be f: SUCCESS
5-
\[main\.assertion\.2\] line \d+ assertion fp\(\) == 1: SUCCESS
4+
\[main\.pointer_dereference\.1\] line \d+ dereferenced function pointer must be f: SUCCESS
5+
\[main\.assertion\.1\] line \d+ assertion fp\(\) == 1: SUCCESS
66
f\(\)
77
^EXIT=0$
88
^SIGNAL=0$

0 commit comments

Comments
 (0)