Skip to content

Redirect edges leaving an exception handler to handler blocks through abnormal edges #12

Description

@Washi1337

Summary:
The handler region is often a region that is considered unreachable through normal execution paths. They therefore look very similar to orphan jumps in the resulting control flow graph, whereas in fact nodes within a protected region might transfer control to one of the handlers. Furthermore, for constructs like the try-finally, the actual "exception-less" flow might not be correctly encoded in the graph.

The suggestion is:

  • To add an option to add abnormal edges from every node within the protected region to the handler blocks.
  • To add an option to redirect edges that leave an exception handler to the handler block when necessary (for finally blocks), and add abnormal edges at the leaves of such a finally block to the original destination addresses.
A try-catch with orphan handler blocks

Screenshot_20200407_010607

Try-catch after enabling option 1

Screenshot_20200407_010731

Try-finally with orphan handler and inaccurate flow control

Screenshot_20200407_010932

Try-finally after enabling option 2

Screenshot_20200407_011136

Metadata

Metadata

Assignees

No one assigned

    Labels

    control-flowIssue related to the control flow analysis modules of Echo.enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions