File tree Expand file tree Collapse file tree 4 files changed +41
-5
lines changed
regression/cbmc/reachability-slice-interproc2 Expand file tree Collapse file tree 4 files changed +41
-5
lines changed Original file line number Diff line number Diff line change
1
+ void b ();
2
+
3
+ void c ()
4
+ {
5
+ __CPROVER_assert (0 , "" );
6
+ b ();
7
+ }
8
+
9
+ void b ()
10
+ {
11
+ a ();
12
+ c ();
13
+ }
14
+
15
+ void a ()
16
+ {
17
+ c ();
18
+ }
19
+
20
+ int main ()
21
+ {
22
+ a ();
23
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --reachability-slice --show-goto-functions
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ main\(\)
7
+ --
8
+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -74,9 +74,13 @@ void reachability_slicert::fixedpoint_to_assertions(
74
74
const auto caller_is_known = stack.back ().caller_is_known ;
75
75
stack.pop_back ();
76
76
77
- if (node.reaches_assertion )
77
+ if (
78
+ node.reaches_assertion .is_true () ||
79
+ (caller_is_known && node.reaches_assertion .is_unknown ()))
80
+ {
78
81
continue ;
79
- node.reaches_assertion = true ;
82
+ }
83
+ node.reaches_assertion = caller_is_known ? tvt::unknown () : tvt (true );
80
84
81
85
for (const auto &edge : node.in )
82
86
{
@@ -195,7 +199,7 @@ void reachability_slicert::slice(goto_functionst &goto_functions)
195
199
{
196
200
const cfgt::nodet &e=cfg[cfg.entry_map [i_it]];
197
201
if (
198
- ! e.reaches_assertion && !e.reachable_from_assertion &&
202
+ e.reaches_assertion . is_false () && !e.reachable_from_assertion &&
199
203
!i_it->is_end_function ())
200
204
i_it->make_assumption (false_exprt ());
201
205
}
Original file line number Diff line number Diff line change @@ -38,11 +38,12 @@ class reachability_slicert
38
38
protected:
39
39
struct slicer_entryt
40
40
{
41
- slicer_entryt () : reaches_assertion(false ), reachable_from_assertion(false )
41
+ slicer_entryt ()
42
+ : reaches_assertion(tvt(false )), reachable_from_assertion(false )
42
43
{
43
44
}
44
45
45
- bool reaches_assertion;
46
+ tvt reaches_assertion;
46
47
bool reachable_from_assertion;
47
48
};
48
49
You can’t perform that action at this time.
0 commit comments