falconre / falcon

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

Add functions to determine vertices without successors/predecossr and to remove unreachable vertices #68

Closed emmanuel099 closed 4 years ago

endeav0r commented 4 years ago

Slightly alarmed. How are we making/transforming graphs such that we have orphaned vertices?

emmanuel099 commented 4 years ago

How are we making/transforming graphs such that we have orphaned vertices?

For encoding transient execution behavior, I duplicate the CFG and add edges from the "normal" (orange) into the "transient" CFG (grey) and vice versa. This may generate orphaned vertices in the "transient" CFG, because some vertices may be unreachable from the CFG entry node.

Before (vertices not reachable by CFG entry are in the red area): image

After removing unreachable vertices: image

I thought this function may be useful for upstream as well.