Skip to content

Commit 52ceb9b

Browse files
author
martin
committed
Remove redundant try/catch blocks from goto-analyzer
Using the previous commit these should increase the consistency of how exceptions are handled.
1 parent da4cc61 commit 52ceb9b

File tree

1 file changed

+3
-51
lines changed

1 file changed

+3
-51
lines changed

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -396,29 +396,8 @@ int goto_analyzer_parse_optionst::doit()
396396

397397
register_languages();
398398

399-
try
400-
{
401-
goto_model =
402-
initialize_goto_model(cmdline.args, get_message_handler(), options);
403-
}
404-
405-
catch(const char *e)
406-
{
407-
error() << e << eom;
408-
return CPROVER_EXIT_EXCEPTION;
409-
}
410-
411-
catch(const std::string &e)
412-
{
413-
error() << e << eom;
414-
return CPROVER_EXIT_EXCEPTION;
415-
}
416-
417-
catch(int e)
418-
{
419-
error() << "Numeric exception: " << e << eom;
420-
return CPROVER_EXIT_EXCEPTION;
421-
}
399+
goto_model =
400+
initialize_goto_model(cmdline.args, get_message_handler(), options);
422401

423402
if(process_goto_program(options))
424403
return CPROVER_EXIT_INTERNAL_ERROR;
@@ -448,34 +427,7 @@ int goto_analyzer_parse_optionst::doit()
448427
return CPROVER_EXIT_SUCCESS;
449428
}
450429

451-
try
452-
{
453-
return perform_analysis(options);
454-
}
455-
456-
catch(const char *e)
457-
{
458-
error() << e << eom;
459-
return CPROVER_EXIT_EXCEPTION;
460-
}
461-
462-
catch(const std::string &e)
463-
{
464-
error() << e << eom;
465-
return CPROVER_EXIT_EXCEPTION;
466-
}
467-
468-
catch(int e)
469-
{
470-
error() << "Numeric exception: " << e << eom;
471-
return CPROVER_EXIT_EXCEPTION;
472-
}
473-
474-
catch(const std::bad_alloc &)
475-
{
476-
error() << "Out of memory" << eom;
477-
return CPROVER_EXIT_INTERNAL_OUT_OF_MEMORY;
478-
}
430+
return perform_analysis(options);
479431
}
480432

481433

0 commit comments

Comments
 (0)