Skip to content

Commit 444d824

Browse files
committed
Fix graphml output of concurrency witnesses
The START_THREAD instruction may induce a number of assignments, which end up as assignment in the symex_target_equation while the corresponding pc still points to a START_THREAD instruction. Hence testing assignments must be done consistently either within the symex_target_equation or within the goto program level.
1 parent 728dbb5 commit 444d824

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int global;
2+
3+
int main()
4+
{
5+
__CPROVER_ASYNC_1: global=1;
6+
global=2;
7+
assert(global==2); // to fail
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
main.c
3+
--graphml-witness -
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
8+
</graphml>
9+
--
10+
^warning: ignoring

src/goto-programs/graphml_witness.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static bool filter_out(
141141
goto_tracet::stepst::const_iterator &it)
142142
{
143143
if(it->hidden &&
144-
(!it->is_assignment() ||
144+
(!it->pc->is_assign() ||
145145
to_code_assign(it->pc->code).rhs().id()!=ID_side_effect ||
146146
to_code_assign(it->pc->code).rhs().get(ID_statement)!=ID_nondet))
147147
return true;

0 commit comments

Comments
 (0)