@@ -1091,17 +1091,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
1091
1091
ret_instructions.push_back (i_it);
1092
1092
}
1093
1093
}
1094
-
1095
- // Draw edges from every `ret` to every `jsr` successor. Could do better with
1096
- // flow analysis to distinguish multiple subroutines within the same function.
1097
- for (const auto retinst : ret_instructions)
1098
- {
1099
- auto &a_entry=address_map.at (retinst->address );
1100
- a_entry.successors .insert (
1101
- a_entry.successors .end (),
1102
- jsr_ret_targets.begin (),
1103
- jsr_ret_targets.end ());
1104
- }
1094
+ draw_edges_from_ret_to_jsr (address_map, jsr_ret_targets, ret_instructions);
1105
1095
1106
1096
for (const auto &address : address_map)
1107
1097
{
@@ -2719,6 +2709,22 @@ codet java_bytecode_convert_methodt::convert_instructions(
2719
2709
return code;
2720
2710
}
2721
2711
2712
+ void java_bytecode_convert_methodt::draw_edges_from_ret_to_jsr (
2713
+ java_bytecode_convert_methodt::address_mapt &address_map,
2714
+ const std::vector<unsigned int > &jsr_ret_targets,
2715
+ const std::vector<
2716
+ std::vector<java_bytecode_parse_treet::instructiont>::const_iterator>
2717
+ &ret_instructions) const
2718
+ { // Draw edges from every `ret` to every `jsr` successor. Could do better with
2719
+ // flow analysis to distinguish multiple subroutines within the same function.
2720
+ for (const auto &retinst : ret_instructions)
2721
+ {
2722
+ auto &a_entry = address_map.at (retinst->address );
2723
+ a_entry.successors .insert (
2724
+ a_entry.successors .end (), jsr_ret_targets.begin (), jsr_ret_targets.end ());
2725
+ }
2726
+ }
2727
+
2722
2728
std::vector<unsigned > java_bytecode_convert_methodt::try_catch_handler (
2723
2729
const unsigned int address,
2724
2730
const java_bytecode_parse_treet::methodt::exception_tablet &exception_table)
0 commit comments