Skip to content

Commit cb61d28

Browse files
AssertionError can also be caught
Treating it differently would be wrong.
1 parent 1f64e15 commit cb61d28

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/goto-programs/remove_exceptions.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,7 @@ bool remove_exceptionst::function_or_callees_may_throw(
162162
{
163163
if(instr_it->is_throw())
164164
{
165-
const exprt &exc =
166-
uncaught_exceptions_domaint::get_exception_symbol(instr_it->code);
167-
bool is_assertion_error =
168-
id2string(uncaught_exceptions_domaint::get_exception_type(exc.type())).
169-
find("java.lang.AssertionError")!=std::string::npos;
170-
if(!is_assertion_error)
171-
return true;
165+
return true;
172166
}
173167

174168
if(instr_it->is_function_call())
@@ -379,15 +373,6 @@ void remove_exceptionst::instrument_throw(
379373

380374
const exprt &exc_expr=
381375
uncaught_exceptions_domaint::get_exception_symbol(instr_it->code);
382-
bool assertion_error=id2string(
383-
uncaught_exceptions_domaint::get_exception_type(exc_expr.type())).
384-
find("java.lang.AssertionError")!=std::string::npos;
385-
386-
// we don't count AssertionError (we couldn't catch it anyway
387-
// and this may reduce the instrumentation considerably if the programmer
388-
// used assertions)
389-
if(assertion_error)
390-
return;
391376

392377
add_exception_dispatch_sequence(
393378
goto_program, instr_it, stack_catch, locals);

0 commit comments

Comments
 (0)