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

feat: throw and nativeThrow in return reachability analysis #447

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

anton-trunov
Copy link
Member

@anton-trunov anton-trunov commented Jun 21, 2024

Closes #421

  • I have updated CHANGELOG.md
  • I have added tests to demonstrate the contribution is correctly implemented: this usually includes both positive and negative tests, showing the happy path(s) and featuring intentionally broken cases
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@anton-trunov anton-trunov added this to the v1.4.0 milestone Jun 21, 2024
@anton-trunov anton-trunov self-assigned this Jun 21, 2024
novusnota
novusnota previously approved these changes Jun 21, 2024
Copy link
Member

@novusnota novusnota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! There are also nativeThrowWhen() and nativeThrowUnless(), but those aren't checked as easily :)

@novusnota novusnota self-requested a review June 21, 2024 09:40
@novusnota novusnota dismissed their stale review June 21, 2024 09:41

Missed cases

@anton-trunov
Copy link
Member Author

There are also nativeThrowWhen() and nativeThrowUnless(), but those aren't checked as easily :)

The return reachability analysis we use is really dumb: it won't check if an arbitrary function always throws and it won't try to determine if the condition is always true/false for nativeThrowWhen() and nativeThrowUnless(), it won't analyze assembly wrapped into a FunC function, etc.

@anton-trunov anton-trunov merged commit bd7c7cb into main Jun 21, 2024
3 checks passed
@anton-trunov anton-trunov deleted the return-reachability-throw branch June 21, 2024 11:43
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

Successfully merging this pull request may close these issues.

return-reachability analysis should take unconditional throw into account
3 participants