Skip to content

Commit 57c59fc

Browse files
authored
Merge pull request diffblue#6650 from tautschnig/bugfixes/paths-invariant
Single-path symex must not fail an invariant when verification succeeds
2 parents 770d791 + 4c2c27d commit 57c59fc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

regression/cbmc/Address_of1/test.desc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
CORE
22
main.c
3-
3+
--stop-on-fail
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
77
--
88
^warning: ignoring
9+
--
10+
Adding "--stop-on-fail" should not make a difference for successful
11+
verification, but previously caused an invariant failure when running CBMC with
12+
"--paths."

src/goto-checker/single_path_symex_checker.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ operator()(propertiest &properties)
7575
return result;
7676
}
7777

78+
// leave the last worklist item in place for the benefit of output_proof
79+
if(worklist->size() == 1)
80+
break;
81+
7882
worklist->pop();
7983
}
8084

@@ -83,7 +87,7 @@ operator()(propertiest &properties)
8387

8488
final_update_properties(properties, result.updated_properties);
8589

86-
// Worklist is empty: we are done.
90+
// Worklist just has the last element left: we are done.
8791
return result;
8892
}
8993

@@ -182,6 +186,8 @@ void single_path_symex_checkert::output_error_witness(
182186
void single_path_symex_checkert::output_proof()
183187
{
184188
// This is incorrect, but the best we can do at the moment.
189+
// operator()(propertiest &properties) leaves in place the last worklist item
190+
// just for this purpose.
185191
const path_storaget::patht &resume = worklist->peek();
186192
output_graphml(resume.equation, ns, options);
187193
}

0 commit comments

Comments
 (0)