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 infinite recursion of expanded nodes in UnreachableVisitor #13922

Conversation

straight-shoota
Copy link
Member

We're already remembering which def bodies have been visited in order to prevent revisits. Apparently, ExpandableNode can be reached multiple times as well.
This patch generalizes the register to contain any ASTNode and uses it for ExpandableNode as well.

This bug appeard for crystal tool unreachable spec/compiler_spec.cr. With this patch it works fine.
I could not find a reduced example for a spec.

We're already remembering which def bodies have been visited in order to
prevent revisits. Apparently, `ExpandableNode` can be reached multiple
times as well.
This patch generalizes the register to contain any `ASTNode` and uses it
for `ExpandableNode` as well.
@straight-shoota straight-shoota added this to the 1.11.0 milestone Nov 4, 2023
@straight-shoota straight-shoota merged commit 082ee49 into crystal-lang:master Nov 5, 2023
54 of 55 checks passed
@straight-shoota straight-shoota deleted the fix/unreachable-infinite-recursion branch November 5, 2023 13:21
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:unreachable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants