Skip to content

Commit 52839ed

Browse files
committed
dfcc_wrapper_programt::encode_ensures_clauses: remove unnecessary local
We can directly append to the history program rather than crafting a local program and then appending that in turn.
1 parent 8468683 commit 52839ed

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/goto-instrument/contracts/dynamic-frames/dfcc_wrapper_program.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,6 @@ void dfcc_wrapper_programt::encode_ensures_clauses()
617617
const auto &statement_type =
618618
(contract_mode == dfcc_contract_modet::CHECK) ? ID_assert : ID_assume;
619619

620-
// goto program where all history variable snapshots are added
621-
goto_programt history_snapshot_program;
622-
623620
// goto program where all requires are added
624621
goto_programt ensures_program;
625622

@@ -634,10 +631,7 @@ void dfcc_wrapper_programt::encode_ensures_clauses()
634631

635632
// this also rewrites ID_old expressions to fresh variables
636633
generate_history_variables_initialization(
637-
goto_model.symbol_table,
638-
ensures,
639-
language_mode,
640-
history_snapshot_program);
634+
goto_model.symbol_table, ensures, language_mode, history);
641635

642636
source_locationt sl(e.source_location());
643637
if(statement_type == ID_assert)
@@ -672,9 +666,6 @@ void dfcc_wrapper_programt::encode_ensures_clauses()
672666
address_of_ensures_write_set,
673667
function_pointer_contracts);
674668

675-
// add the snapshot program in the history section
676-
history.destructive_append(history_snapshot_program);
677-
678669
// add the ensures program to the postconditions section
679670
postconditions.destructive_append(ensures_program);
680671
}

0 commit comments

Comments
 (0)