Skip to content

Commit a9a6986

Browse files
committed
reject contracts on do/while loops for now
1 parent f1d4b2f commit a9a6986

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/goto-instrument/contracts/contracts.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,14 @@ void code_contractst::check_apply_loop_contracts(
236236
new_decreases_vars.push_back(new_decreases_var);
237237
}
238238

239-
// non-deterministically skip the loop if it is a do-while loop.
240239
// TODO: Fix loop contract issues for do/while loops.
241240
if(!loop_head->is_goto())
242241
{
242+
log.error() << "Loop contracts are currently unsupported on do/while loops."
243+
<< loop_head->source_location() << messaget::eom;
244+
throw 0;
245+
246+
// non-deterministically skip the loop if it is a do-while loop.
243247
generated_code.add(goto_programt::make_goto(
244248
loop_end,
245249
side_effect_expr_nondett(bool_typet(), loop_head->source_location())));

0 commit comments

Comments
 (0)