-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Serialization of double-linked-list of tokens breaks recursion limit #1164
Comments
Or perhaps could we come up with a |
I am going to categorize this as a bug, as I believe that serialization of AST nodes should be supported with default PHP settings. A quick fix for you would be to use the parser option
They are neither endless, nor recursive. The tokens form a double-linked-list. I think this data structure was probably copied from the reference implementation
I could see this working too, sure. Traversing the double-linked-list can most certainly be transformed into an iterative algorithm. |
Thanks for the explanation :) I'm afraid this pattern is very new to me (obviously) so I probably won't be able to help very much but I will if I can. |
The output of \GraphQL\Language\Parser::parse contains a tree in every 'loc' field which appears to branch forever:
Now, it doesn't go forever or it would crash for everyone. But get a schema large enough and it does break the recursion limit (default 4096) in
unserialize()
when being pulled out of cache (in Drupal).What purpose do these endless recursive references to 'prev' and 'next' serve? Is it possible they could be limited or removed?
The text was updated successfully, but these errors were encountered: