@@ -399,23 +399,19 @@ std::unique_ptr<goto_symext::statet> goto_symext::initialize_entry_point_state(
399399{
400400 const irep_idt entry_point_id = goto_functionst::entry_point ();
401401
402- const goto_functionst::goto_functiont *start_function;
403- try
404- {
405- start_function = &get_goto_function (entry_point_id);
406- }
407- catch (const std::out_of_range &)
408- {
409- throw unsupported_operation_exceptiont (" the program has no entry point" );
410- }
402+ // Entry point existence must be validated by callers before calling
403+ // this function. If get_goto_function throws std::out_of_range, it
404+ // indicates a precondition violation.
405+ const goto_functionst::goto_functiont &start_function =
406+ get_goto_function (entry_point_id);
411407
412408 // Get our path_storage pointer because this state will live beyond
413409 // this instance of goto_symext, so we can't take the reference directly.
414410 auto *storage = &path_storage;
415411
416412 // create and prepare the state
417413 auto state = std::make_unique<statet>(
418- symex_targett::sourcet (entry_point_id, start_function-> body ),
414+ symex_targett::sourcet (entry_point_id, start_function. body ),
419415 symex_config.max_field_sensitivity_array_size ,
420416 symex_config.simplify_opt ,
421417 language_mode,
@@ -426,11 +422,11 @@ std::unique_ptr<goto_symext::statet> goto_symext::initialize_entry_point_state(
426422 CHECK_RETURN (!state->call_stack ().empty ());
427423
428424 goto_programt::const_targett limit =
429- std::prev (start_function-> body .instructions .end ());
425+ std::prev (start_function. body .instructions .end ());
430426 state->call_stack ().top ().end_of_function = limit;
431427 state->call_stack ().top ().calling_location .pc =
432428 state->call_stack ().top ().end_of_function ;
433- state->call_stack ().top ().hidden_function = start_function-> is_hidden ();
429+ state->call_stack ().top ().hidden_function = start_function. is_hidden ();
434430
435431 state->symex_target = ⌖
436432
@@ -440,17 +436,17 @@ std::unique_ptr<goto_symext::statet> goto_symext::initialize_entry_point_state(
440436 auto emplace_safe_pointers_result =
441437 path_storage.safe_pointers .emplace (entry_point_id, local_safe_pointerst{});
442438 if (emplace_safe_pointers_result.second )
443- emplace_safe_pointers_result.first ->second (start_function-> body );
439+ emplace_safe_pointers_result.first ->second (start_function. body );
444440
445441 path_storage.dirty .populate_dirty_for_function (
446- entry_point_id, * start_function);
442+ entry_point_id, start_function);
447443 state->dirty = &path_storage.dirty ;
448444
449445 // Only enable loop analysis when complexity is enabled.
450446 if (symex_config.complexity_limits_active )
451447 {
452448 // Set initial loop analysis.
453- path_storage.add_function_loops (entry_point_id, start_function-> body );
449+ path_storage.add_function_loops (entry_point_id, start_function. body );
454450 state->call_stack ().top ().loops_info =
455451 path_storage.get_loop_analysis (entry_point_id);
456452 }
0 commit comments