File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
regression/goto-instrument/github_6168_infinite_unwinding_bug Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <stdlib.h>
3
+
4
+ static int adder (const int * a , const int * b )
5
+ {
6
+ return (* a + * b );
7
+ }
8
+
9
+ int main ()
10
+ {
11
+ int x = 1024 ;
12
+
13
+ int (* local_adder )(const int * , const int * ) = adder ;
14
+
15
+ while (x > 0 )
16
+ __CPROVER_loop_invariant (1 == 1 )
17
+ {
18
+ x += local_adder (& x , & x ); // loop detection fails
19
+ //x += adder(&x, &x); // works fine
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --enforce-all-contracts
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ ^\[main.1\] line \d+ Check loop invariant before entry: SUCCESS$
8
+ ^\[main.2\] line \d+ Check that loop invariant is preserved: SUCCESS$
9
+ --
10
+ --
11
+ This is guarding against an issue described in https://github.com/diffblue/cbmc/issues/6168.
You can’t perform that action at this time.
0 commit comments