Skip to content

Commit 6f622d1

Browse files
committed
Fixes for is_threadedt, --is-threaded
1 parent bb88574 commit 6f622d1

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

regression/goto-instrument/is-threaded1/main.c

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11

22
int x;
33

4+
void func3()
5+
{
6+
x = 6;
7+
}
8+
49
void func2()
510
{
611
x = 3;

src/analyses/is_threaded.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ class is_threaded_domaint:public ai_domain_baset
3333
locationt from,
3434
locationt to)
3535
{
36-
// assert(src.reachable);
37-
38-
if(!src.reachable)
39-
return false;
36+
INVARIANT(src.reachable,
37+
"Abstract states are only merged at reachable locations");
4038

4139
bool old_reachable=reachable;
4240
bool old_is_threaded=is_threaded;
@@ -52,10 +50,8 @@ class is_threaded_domaint:public ai_domain_baset
5250
transform(locationt from, locationt to, ai_baset &ai, const namespacet &ns)
5351
final override
5452
{
55-
// assert(reachable);
56-
57-
if(!reachable)
58-
return;
53+
INVARIANT(reachable,
54+
"Transformers are only applied at reachable locations");
5955

6056
if(from->is_start_thread())
6157
is_threaded=true;

src/goto-instrument/goto_instrument_parse_options.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ int goto_instrument_parse_optionst::doit()
257257
<< "\n\n";
258258
}
259259
}
260+
261+
return CPROVER_EXIT_SUCCESS;
260262
}
261263

262264
if(cmdline.isset("show-value-sets"))
@@ -1493,6 +1495,8 @@ void goto_instrument_parse_optionst::help()
14931495
// NOLINTNEXTLINE(whitespace/line_length)
14941496
" --reachable-call-graph show graph of function calls potentially reachable from main function\n"
14951497
" --class-hierarchy show class hierarchy\n"
1498+
// NOLINTNEXTLINE(whitespace/line_length)
1499+
" --show-threaded show instructions that may be executed by more than one thread\n"
14961500
"\n"
14971501
"Safety checks:\n"
14981502
" --no-assertions ignore user assertions\n"

0 commit comments

Comments
 (0)