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

fix: prevent stackoverflow when visiting of cyclic annotation/package structures #4356

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

SirYwell
Copy link
Collaborator

Fixes #4351.

This is a very unfortunate situation that only happens in combination of annotations on packages. When visiting the type reference of an annotation, we're also visiting its package, and if this package is annotated, we'll do the same again.

With this fix, packages are only visited if the contexts don't not already hold a reference to the package.

The tests cover some more complex situations that would have caused similar issues.

@SirYwell SirYwell changed the title wip: fix: prevent recursive visiting of cyclic annotation/package structures review: fix: prevent recursive visiting of cyclic annotation/package structures Dec 15, 2021
@monperrus monperrus changed the title review: fix: prevent recursive visiting of cyclic annotation/package structures fix: prevent stackoverflow when visiting of cyclic annotation/package structures Dec 20, 2021
@monperrus monperrus merged commit 4f0aca9 into INRIA:master Dec 20, 2021
@monperrus
Copy link
Collaborator

thanks @SirYwell

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.

[Bug] annotation in package-info.java throw java.lang.StackOverflowError
2 participants