File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ struct procedure_local_cfg_baset<
32
32
33
33
void operator ()(const method_with_amapt& args)
34
34
{
35
+ const auto &method=args.first ;
35
36
const auto & amap=args.second ;
36
37
for (const auto & inst : amap)
37
38
{
@@ -47,6 +48,29 @@ struct procedure_local_cfg_baset<
47
48
}
48
49
// Add edges declared in the exception table, which don't figure
49
50
// in the address map successors/predecessors as yet.
51
+ for (const auto & table_entry : method.exception_table )
52
+ {
53
+ auto findit=amap.find (table_entry.start_pc );
54
+ assert (findit!=amap.end () &&
55
+ " Exception table entry doesn't point to an instruction?" );
56
+ for (; findit->first <table_entry.end_pc ; ++findit)
57
+ {
58
+ // For now just assume any non-branch
59
+ // instruction could potentially throw.
60
+ auto succit=findit;
61
+ ++succit;
62
+ if (succit==amap.end ())
63
+ continue ;
64
+ const auto & thisinst=findit->second ;
65
+ if (thisinst.successors .size ()==1 &&
66
+ *thisinst.successors .begin ()==succit->first )
67
+ {
68
+ this ->add_edge (
69
+ entry_map.at (findit->first ),
70
+ entry_map.at (table_entry.handler_pc ));
71
+ }
72
+ }
73
+ }
50
74
}
51
75
52
76
unsigned get_first_node (const method_with_amapt& args) const
You can’t perform that action at this time.
0 commit comments