Skip to content

Commit 920acd8

Browse files
author
martin
committed
Remove redundant try/catch blocks from goto-instrument
This does change the exit codes of goto-instrument in the case of exceptions being thrown. Doing so eliminates a long-standing anomoly where goto-instrument had a different exit code for exceptions to all of the other tools.
1 parent 338b155 commit 920acd8

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ int goto_instrument_parse_optionst::doit()
121121
eval_verbosity(
122122
cmdline.get_value("verbosity"), messaget::M_STATISTICS, ui_message_handler);
123123

124-
try
125124
{
126125
register_languages();
127126

@@ -823,30 +822,6 @@ int goto_instrument_parse_optionst::doit()
823822
help();
824823
return CPROVER_EXIT_USAGE_ERROR;
825824
}
826-
827-
catch(const char *e)
828-
{
829-
error() << e << eom;
830-
return CPROVER_EXIT_EXCEPTION_GOTO_INSTRUMENT;
831-
}
832-
833-
catch(const std::string &e)
834-
{
835-
error() << e << eom;
836-
return CPROVER_EXIT_EXCEPTION_GOTO_INSTRUMENT;
837-
}
838-
839-
catch(int e)
840-
{
841-
error() << "Numeric exception : " << e << eom;
842-
return CPROVER_EXIT_EXCEPTION_GOTO_INSTRUMENT;
843-
}
844-
845-
catch(const std::bad_alloc &)
846-
{
847-
error() << "Out of memory" << eom;
848-
return CPROVER_EXIT_EXCEPTION_GOTO_INSTRUMENT;
849-
}
850825
// NOLINTNEXTLINE(readability/fn_size)
851826
}
852827

src/util/exit_codes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Author: Martin Brain, [email protected]
4040
/// An (unanticipated) exception was thrown during computation.
4141
#define CPROVER_EXIT_EXCEPTION 6
4242
// should contemplate EX_SOFTWARE from sysexits.h
43-
#define CPROVER_EXIT_EXCEPTION_GOTO_INSTRUMENT 11
4443

4544
/// An error has been encountered during processing the requested analysis.
4645
#define CPROVER_EXIT_INTERNAL_ERROR 6

0 commit comments

Comments
 (0)