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

Improve jmptbl edges, second try #10662

merged 3 commits into from Jul 8, 2018


Copy link

@cyanpencil cyanpencil commented Jul 8, 2018

So, this is my second try at improving jump tables edges. Here are the main changes:

  1. If a node has more than 2 edges, than those edges are centered in the middle of the node

  2. If a node has more than 2 edges, those edges are sorted based on the x coordinate of their destination. This way they won't overlap when "bending". You can test this by moving the switch block with H and L and see how the bendpoints change accordingly.

  3. Edges with the same origin and destination are merged, so that we have only one edge for multiple cases in one node, resulting in much more clear screen when there is a jumptable.

  4. Killed the graph.altedgepos variable that I introduced in my last pr.

This is before:

This is after:

I tried to test it a lot, there are still a few minor things to fix but this should clear up all the major messes.

@radare radare added this to the 2.7.0 milestone Jul 8, 2018
Copy link

@radare radare commented Jul 8, 2018

seems to look better, but there are still overlapped edges in the bottom part of the cases.

@radare radare merged commit e209b91 into radareorg:master Jul 8, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants