Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track visited element set in ResolveState to prevent StackOverflowError
Fixes #1467 Fixes #1480 Fixes #1418 Numerous users have reported that annotation can encounter a `StackOverflowError`. [A reproduction case](#1475 (comment)) shows that they are called by Phoenix `Web` modules where one function containing `quote` block `use`s the same module again, such as an `admin_view` depending on the base `view` through `use App.Web, :view`. When the `use App.Web, :view` is resolving, the `defmacro __using__` is re-entered as is the `admin_view` because there was no tracking of already visited `PsiElement`s. The fix is to track the visited elements and not re-enter the visited elements so that `admin_view` is skipped and the other call definition clauses can be checked to find `view`.
- Loading branch information
1 parent
69ffa6f
commit 027ded2
Showing
12 changed files
with
296 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.