18
18
19
19
#include < linking/static_lifetime_init.h>
20
20
21
+ #include " java_bytecode_instrument.h"
21
22
#include " java_object_factory.h"
22
23
#include " java_string_literals.h"
23
24
#include " java_utils.h"
@@ -520,6 +521,7 @@ bool java_entry_point(
520
521
const irep_idt &main_class,
521
522
message_handlert &message_handler,
522
523
bool assume_init_pointers_not_null,
524
+ bool assert_uncaught_exceptions,
523
525
const object_factory_parameterst &object_factory_parameters,
524
526
const select_pointer_typet &pointer_type_selector,
525
527
bool string_refinement_enabled)
@@ -554,6 +556,7 @@ bool java_entry_point(
554
556
symbol_table,
555
557
message_handler,
556
558
assume_init_pointers_not_null,
559
+ assert_uncaught_exceptions,
557
560
object_factory_parameters,
558
561
pointer_type_selector);
559
562
}
@@ -576,7 +579,8 @@ bool generate_java_start_function(
576
579
symbol_table_baset &symbol_table,
577
580
message_handlert &message_handler,
578
581
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,
580
584
const select_pointer_typet &pointer_type_selector)
581
585
{
582
586
messaget message (message_handler);
@@ -699,6 +703,13 @@ bool generate_java_start_function(
699
703
// declare certain (which?) variables as test outputs
700
704
java_record_outputs (symbol, main_arguments, init_code, symbol_table);
701
705
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
+
702
713
// create a symbol for the __CPROVER__start function, associate the code that
703
714
// we just built and register it in the symbol table
704
715
symbolt new_symbol;
0 commit comments