1818
1919#include < linking/static_lifetime_init.h>
2020
21+ #include " java_bytecode_instrument.h"
2122#include " java_object_factory.h"
2223#include " java_string_literals.h"
2324#include " java_utils.h"
@@ -520,6 +521,7 @@ bool java_entry_point(
520521 const irep_idt &main_class,
521522 message_handlert &message_handler,
522523 bool assume_init_pointers_not_null,
524+ bool assert_uncaught_exceptions,
523525 const object_factory_parameterst &object_factory_parameters,
524526 const select_pointer_typet &pointer_type_selector,
525527 bool string_refinement_enabled)
@@ -554,6 +556,7 @@ bool java_entry_point(
554556 symbol_table,
555557 message_handler,
556558 assume_init_pointers_not_null,
559+ assert_uncaught_exceptions,
557560 object_factory_parameters,
558561 pointer_type_selector);
559562}
@@ -576,7 +579,8 @@ bool generate_java_start_function(
576579 symbol_table_baset &symbol_table,
577580 message_handlert &message_handler,
578581 bool assume_init_pointers_not_null,
579- const object_factory_parameterst& object_factory_parameters,
582+ bool assert_uncaught_exceptions,
583+ const object_factory_parameterst &object_factory_parameters,
580584 const select_pointer_typet &pointer_type_selector)
581585{
582586 messaget message (message_handler);
@@ -699,6 +703,13 @@ bool generate_java_start_function(
699703 // declare certain (which?) variables as test outputs
700704 java_record_outputs (symbol, main_arguments, init_code, symbol_table);
701705
706+ // add uncaught-exception check if requested
707+ if (assert_uncaught_exceptions)
708+ {
709+ java_bytecode_instrument_uncaught_exceptions (
710+ init_code, exc_symbol, symbol.location );
711+ }
712+
702713 // create a symbol for the __CPROVER__start function, associate the code that
703714 // we just built and register it in the symbol table
704715 symbolt new_symbol;
0 commit comments