falconre / falcon

Binary Analysis Framework in Rust
Apache License 2.0
549 stars 47 forks source link

Graph: Replace edges_in/out by a set of predecessors/successors #61

Closed emmanuel099 closed 4 years ago

emmanuel099 commented 4 years ago

The old approach had the big problem that Edges were duplicated multiple times. Therefore, changing an edge by e.g. Graph::edge_mut can result in out of sync information between edges, edges_in and edges_out.

The new approach still allows fast lookup of edge targets (successors/predecessors), but avoids the duplication by storing vertex indices instead.

Another fix for this problem would be to use ref-counted edges instead.

endeav0r commented 4 years ago

It took me a minute to understand what you were talking about, got it, merging.