File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed
regression/cbmc/unwind_counters4 Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change
1
+ int main ()
2
+ {
3
+ int x ;
4
+ int y ;
5
+
6
+ do
7
+ {
8
+ y = 10 ;
9
+ goto label ;
10
+ x = 1 ; // dead code, makes sure the above goto is not removed
11
+ label :
12
+ _Bool nondet ;
13
+ if (nondet )
14
+ __CPROVER_assert (y != 10 , "violated via first loop" );
15
+ else
16
+ __CPROVER_assert (y != 20 , "violated via second loop" );
17
+
18
+ if (x % 2 )
19
+ break ; // this statement must not cause the loop counter to be reset
20
+ } while (1 );
21
+
22
+ y = 20 ;
23
+ goto label ;
24
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --unwind 2
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION FAILED$
7
+ ^\** 2 of 2 failed
8
+ --
9
+ --
10
+ Loop unwinding must terminate despite the existence of multiple loop entry
11
+ points.
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ void symex_transition(
97
97
for (const auto &i_e : instruction.incoming_edges )
98
98
{
99
99
if (
100
- i_e->is_goto () && i_e->is_backwards_goto () &&
100
+ i_e->is_backwards_goto () && i_e->get_target () == to &&
101
101
(!is_backwards_goto ||
102
102
state.source .pc ->location_number > i_e->location_number ))
103
103
{
You can’t perform that action at this time.
0 commit comments