@@ -578,11 +578,15 @@ void dfcc_wrapper_programt::encode_requires_clauses()
578
578
memory_predicates.fix_calls (requires_program);
579
579
580
580
// instrument for side effects
581
+ // make the program well-formed
582
+ requires_program.add (goto_programt::make_end_function ());
581
583
instrument.instrument_goto_program (
582
584
wrapper_id,
583
585
requires_program,
584
586
addr_of_requires_write_set,
585
587
function_pointer_contracts);
588
+ // turn it back into a sequence of statements
589
+ requires_program.instructions .back ().turn_into_skip ();
586
590
587
591
// append resulting program to preconditions section
588
592
preconditions.destructive_append (requires_program);
@@ -637,11 +641,15 @@ void dfcc_wrapper_programt::encode_ensures_clauses()
637
641
memory_predicates.fix_calls (ensures_program);
638
642
639
643
// instrument for side effects
644
+ // make the program well-formed
645
+ ensures_program.add (goto_programt::make_end_function ());
640
646
instrument.instrument_goto_program (
641
647
wrapper_id,
642
648
ensures_program,
643
649
addr_of_ensures_write_set,
644
650
function_pointer_contracts);
651
+ // turn it back into a sequence of statements
652
+ ensures_program.instructions .back ().turn_into_skip ();
645
653
646
654
// add the ensures program to the postconditions section
647
655
postconditions.destructive_append (ensures_program);
0 commit comments