@@ -109,10 +109,13 @@ void sec_driver_parse_optionst::get_command_line_options(optionst &options)
109
109
110
110
static irep_idt get_cprover_start_main_callee (const goto_modelt &goto_model)
111
111
{
112
- const goto_programt &start_body =
113
- goto_model.get_goto_functions ().function_map .at (
114
- goto_functionst::entry_point ()).body ;
112
+ const goto_functionst::function_mapt &function_map =
113
+ goto_model.get_goto_functions ().function_map ;
114
+ auto entry_it = function_map.find (goto_functionst::entry_point ());
115
+ if (entry_it == function_map.end ())
116
+ return {};
115
117
118
+ const goto_programt &start_body = entry_it->second .body ;
116
119
auto last_call_it =
117
120
std::find_if (
118
121
start_body.instructions .rbegin (),
@@ -242,12 +245,15 @@ int sec_driver_parse_optionst::doit()
242
245
local_value_set_analysist::dbt summarydb (serializer, 30 );
243
246
namespacet ns (goto_model.symbol_table );
244
247
245
- const std::string function_name = cmdline.get_value (" function" );
246
248
const bool print_function_summary = cmdline.isset (" show-value-sets" );
247
249
const bool print_all_summaries = cmdline.isset (" show-value-sets-all" );
248
250
249
- irep_idt fully_qualified_name =
250
- get_cprover_start_main_callee (goto_model);
251
+ irep_idt fully_qualified_name = get_cprover_start_main_callee (goto_model);
252
+ if (fully_qualified_name.empty ())
253
+ {
254
+ error () << " You must specify an entry point with --function" << eom;
255
+ return CPROVER_EXIT_USAGE_ERROR;
256
+ }
251
257
252
258
call_grapht const call_graph (goto_model.goto_functions );
253
259
std::vector<irep_idt> process_order =
0 commit comments