We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc99037 commit 1b34d7cCopy full SHA for 1b34d7c
src/goto-instrument/contracts/contracts.cpp
@@ -209,7 +209,10 @@ void code_contractst::check_apply_loop_contracts(
209
converter.goto_convert(old_decreases_assignment, havoc_code, mode);
210
}
211
212
- goto_function.body.destructive_insert(std::next(loop_head), havoc_code);
+ const auto head_loc = loop_head->source_location();
213
+ while(loop_head->source_location() == head_loc)
214
+ loop_head = std::next(loop_head);
215
+ goto_function.body.destructive_insert(loop_head, havoc_code);
216
217
218
// Generate: assert(invariant) just after the loop exits
0 commit comments