-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bugs found during php-corpus check (#273)
Running NoVerify on the big open source code corpus revealed several bugs: 1. GetRootNode now returns *node.Root instead of node.Node, we assigned that to node.Node vairable and nil check was broken, causing linter to panic on nil nodes instead of giving "empty root node" notice. 2. Calling EnterNode on anon class gives a panic, since class name is nil and we can't set current class name because of that. Since a lot of class handling relies on current class name being available, skip anon class handling for now by returning false for these nodes. This cludge can be removed when #272 is resolved. 3. We can't eagerly resolve ClassConstFetch if ExprType is called when indexing is incomplete as it uses FindClass function that depends on meta.Index being complete. This causes race condition in fact (concurrent map reads and writes). Fixed by introducing wrapped class const fetch type. Signed-off-by: Iskander Sharipov <[email protected]>
- Loading branch information
Showing
6 changed files
with
33 additions
and
8 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