Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Washi1337 opened this issue Apr 6, 2020 · 0 comments
Labels
control-flow Issue related to the control flow analysis modules of Echo. enhancement New feature or request

Comments

@Washi1337
Copy link
Owner

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

@Washi1337 Washi1337 added enhancement New feature or request control-flow Issue related to the control flow analysis modules of Echo. labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control-flow Issue related to the control flow analysis modules of Echo. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant