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

Is there a problem with Binaryninja nature_loops function? #81

Open
chumen77 opened this issue Dec 18, 2023 · 0 comments
Open

Is there a problem with Binaryninja nature_loops function? #81

chumen77 opened this issue Dec 18, 2023 · 0 comments

Comments

@chumen77
Copy link

def natural_loops(target: Function) -> int:
return sum([bb in bb.dominance_frontier for bb in target.basic_blocks])

The len() function will then return the length of this list, which is the number of basic blocks in target.basic_blocks, not the number of natural loops.

If you want to count the number of basic blocks that exist within their own dominance bounds (actually the number of natural loops), then you should use sum() instead of len().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant