-
Notifications
You must be signed in to change notification settings - Fork 979
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
[Bug]: Dominator-deadcode problem #1973
Comments
@Tiko7454 Thanks for reporting this and providing an example! It's really helpful |
This was introduced here 371e3cb#diff-da17d02003c2bcfd4974cafb281c5b587b72398a8de28f65a8963cfa5f029970R98 |
I think we can have an attribute is_reachable for every node, which shows whether there is a path from ENTRY_POINT to that node. The attribute can be set with a DFS from the ENTRY_POINT. Then when we are getting the dominators of a node, we can intersect the dominators of the father nodes which are reachable only |
Also #1982 doesn't fully solve the problem because IF_LOOP node doesn't have any dominator except itself though BEGIN_LOOP is a dominator (IF_LOOP is not reachable from i++ node so by the definition BEGIN_LOOP is a dominator) |
Hi guys, what about that? I'm facing the same error |
Closed by #1984 |
Hello @0xalpharush How are you today? |
Describe the issue:
The i++ node has no father though it's not an ENTRY_POINT, so the only dominator of the node i++ is i++ itself. So when slither wants to find dominators for IF_LOOP node, it intersects the dominators of BEGIN_LOOP and i++, and gets nothing. Thus IF_LOOP has no immediate dominator which throws an assertion error
Code example to reproduce the issue:
Version:
0.9.3
Relevant log output:
The text was updated successfully, but these errors were encountered: