Skip to content

Commit 283d820

Browse files
author
Remi Delmas
committed
CONTRACTS: return set by value
1 parent ab34101 commit 283d820

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ dfcc_libraryt::get_havoc_hook(const irep_idt &function_id) const
209209
return {};
210210
}
211211

212-
void dfcc_libraryt::get_missing_funs(std::set<irep_idt> &missing)
212+
std::set<irep_idt> dfcc_libraryt::get_missing_funs()
213213
{
214-
missing.clear();
214+
std::set<irep_idt> missing;
215215

216216
// add `malloc` since it is needed used by the `is_fresh` function
217217
missing.insert("malloc");
@@ -243,6 +243,7 @@ void dfcc_libraryt::get_missing_funs(std::set<irep_idt> &missing)
243243
missing.insert(pair.second);
244244
}
245245
}
246+
return missing;
246247
}
247248

248249
bool dfcc_libraryt::loaded = false;
@@ -283,8 +284,7 @@ void dfcc_libraryt::load(std::set<irep_idt> &to_instrument)
283284
to_load, tmp_symbol_table, message_handler);
284285

285286
// compute missing library functions before modifying the symbol table
286-
std::set<irep_idt> missing;
287-
get_missing_funs(missing);
287+
std::set<irep_idt> missing = get_missing_funs();
288288

289289
// copy all loaded symbols to the main symbol table
290290
for(const auto &symbol_pair : tmp_symbol_table.symbols)

src/goto-instrument/contracts/dynamic-frames/dfcc_library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class dfcc_libraryt
173173

174174
/// Collects the names of all library functions currently missing from the
175175
/// goto_model into `missing`.
176-
void get_missing_funs(std::set<irep_idt> &missing);
176+
std::set<irep_idt> get_missing_funs();
177177

178178
/// Inlines library functions that need to be inlined before use
179179
void inline_functions();

0 commit comments

Comments
 (0)