Skip to content

Fix a potential StackOverflow in recursion detection code #6013

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

Merged

Conversation

abgruszecki
Copy link
Contributor

Since the length of the chain of RecursionOverflows is proportional to stack size, it's best to build recursions in a loop to avoid a potential stack overflow.

See #5862 (comment).

Copy link
Contributor

@Blaisorblade Blaisorblade left a comment

Choose a reason for hiding this comment

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

LGTM. It's not clear whether this is needed, but this code is more clearly stack-safe.

@Blaisorblade Blaisorblade merged commit 4c4d5a1 into scala:master Mar 4, 2019
@Blaisorblade Blaisorblade deleted the improve-recursion-detection branch March 4, 2019 12:34
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.

2 participants