Skip to content

Commit e1f5644

Browse files
authored
Merge pull request #2964 from diffblue/fixup-e59511c9168f04cb21e85642aa8875c1cb4b4
Fixup e59511c
2 parents 64270dd + 637afdc commit e1f5644

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,14 +897,16 @@ void goto_instrument_parse_optionst::get_goto_program()
897897
{
898898
status() << "Reading GOTO program from `" << cmdline.args[0] << "'" << eom;
899899

900+
config.set(cmdline);
901+
900902
auto result = read_goto_binary(cmdline.args[0], get_message_handler());
901903

902904
if(!result.has_value())
903905
throw 0;
904906

905907
goto_model = std::move(result.value());
906908

907-
config.set(cmdline);
909+
config.set_from_symbol_table(goto_model.symbol_table);
908910
}
909911

910912
void goto_instrument_parse_optionst::instrument_goto_program()

src/goto-programs/read_goto_binary.cpp

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ Module: Read Goto Programs
2727
#include "elf_reader.h"
2828
#include "osx_fat_reader.h"
2929

30+
/// \brief Read a goto binary from a file, but do not update \ref config
31+
/// \param filename the file name of the goto binary
32+
/// \param dest the goto model returned
33+
/// \param message_handler for diagnostics
34+
/// \deprecated Use read_goto_binary(file, message_handler) instead
35+
/// \return true on failure, false on success
3036
bool read_goto_binary(
3137
const std::string &filename,
3238
goto_modelt &dest,
@@ -36,6 +42,10 @@ bool read_goto_binary(
3642
filename, dest.symbol_table, dest.goto_functions, message_handler);
3743
}
3844

45+
/// \brief Read a goto binary from a file, but do not update \ref config
46+
/// \param filename the file name of the goto binary
47+
/// \param message_handler for diagnostics
48+
/// \return goto model on success, {} on failure
3949
optionalt<goto_modelt>
4050
read_goto_binary(const std::string &filename, message_handlert &message_handler)
4151
{
@@ -50,6 +60,12 @@ read_goto_binary(const std::string &filename, message_handlert &message_handler)
5060
return std::move(dest);
5161
}
5262

63+
/// \brief Read a goto binary from a file, but do not update \ref config
64+
/// \param filename the file name of the goto binary
65+
/// \param symbol_table the symbol table from the goto binary
66+
/// \param goto_functions the goto functions from the goto binary
67+
/// \param message_handler for diagnostics
68+
/// \return true on failure, false on success
5369
bool read_goto_binary(
5470
const std::string &filename,
5571
symbol_tablet &symbol_table,
@@ -206,8 +222,10 @@ bool is_goto_binary(const std::string &filename)
206222
return false;
207223
}
208224

209-
/// reads an object file
210-
/// \par parameters: a file_name
225+
/// \brief reads an object file, and also updates config
226+
/// \param file_name file name of the goto binary
227+
/// \param dest the goto model returned
228+
/// \param message_handler for diagnostics
211229
/// \return true on error, false otherwise
212230
bool read_object_and_link(
213231
const std::string &file_name,
@@ -241,8 +259,9 @@ bool read_object_and_link(
241259
return false;
242260
}
243261

244-
/// reads an object file
245-
/// \par parameters: a file_name
262+
/// \brief reads an object file, and also updates the config
263+
/// \param file_name file name of the goto binary
264+
/// \param message_handler for diagnostics
246265
/// \return true on error, false otherwise
247266
bool read_object_and_link(
248267
const std::string &file_name,

0 commit comments

Comments
 (0)