@@ -642,7 +642,8 @@ int jbmc_parse_optionst::get_goto_program(
642
642
}
643
643
644
644
void jbmc_parse_optionst::process_goto_function (
645
- goto_model_functiont &function)
645
+ goto_model_functiont &function,
646
+ const can_produce_functiont &available_functions)
646
647
{
647
648
symbol_tablet &symbol_table = function.get_symbol_table ();
648
649
goto_functionst::goto_functiont &goto_function = function.get_goto_function ();
@@ -655,6 +656,14 @@ void jbmc_parse_optionst::process_goto_function(
655
656
remove_instanceof (goto_function, symbol_table);
656
657
// Java virtual functions -> explicit dispatch tables:
657
658
remove_virtual_functions (function);
659
+
660
+ auto function_is_stub =
661
+ [&symbol_table, &available_functions](const irep_idt &id) { // NOLINT(*)
662
+ return symbol_table.lookup_ref (id).value .is_nil () &&
663
+ !available_functions.can_produce_function (id);
664
+ };
665
+
666
+ remove_returns (function, function_is_stub);
658
667
}
659
668
660
669
catch (const char *e)
@@ -692,9 +701,6 @@ bool jbmc_parse_optionst::process_goto_functions(
692
701
// instrument library preconditions
693
702
instrument_preconditions (goto_model);
694
703
695
- // remove returns, gcc vectors, complex
696
- remove_returns (goto_model);
697
-
698
704
// Similar removal of java nondet statements:
699
705
// TODO Should really get this from java_bytecode_language somehow, but we
700
706
// don't have an instance of that here.
0 commit comments