Skip to content

Commit 0d0b964

Browse files
committed
Add no initialisation PRECONDITION to wp_decl
This function does not account for the case where a code_declt contains `initialization`. Given that the test suite passes with this PRECONDITION is in place, such statements must be separated out before this function is reached. Should this condition be violated in future, then the CONDITION can be removed and the handling of this case implemented.
1 parent 111d05f commit 0d0b964

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/goto-programs/wp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ exprt wp_decl(
226226
const exprt &post,
227227
const namespacet &ns)
228228
{
229+
PRECONDITION(!code.initial_value());
229230
// Model decl(var) as var = nondet()
230231
const exprt &var = code.symbol();
231232
side_effect_expr_nondett nondet(var.type(), source_locationt());

0 commit comments

Comments
 (0)