Repository navigation
Parser: optionally charge infix operator chains to the recursion limit - #3057
Open
moshap-firebolt wants to merge 1 commit into
Open
moshap-firebolt wants to merge 1 commit into
moshap-firebolt wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No dialect label was applied because the title does not name a SQL dialect. If this change targets one or more dialects, edit the title to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3057 +/- ##
=======================================
Coverage 83.57% 83.57%
=======================================
Files 42 42
Lines 35719 35724 +5
Branches 35719 35724 +5
=======================================
+ Hits 29853 29858 +5
Misses 2425 2425
Partials 3441 3441 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
What is the reason for having this optional? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
parse_subexprparses a chain such as1 + 1 + ... + 1in a loop, so the whole chain costs one level of the recursion limit, yet the resultingExprnests one level per operator. Dropping or serializing it recurses that deep: a million-term chain overflows a 64 MiB stack in serde'sSerialize.Parser::with_infix_chain_depth(true)charges each operator of the chain to the recursion counter, so the limit bounds the depth of the tree that is built. It is off by default, sincevisitor::tests::overflowexpects a 1,000-termORchain to parse under the default limit of 50.Test:
parse_infix_chain_with_chain_depth_hits_recursion_limits.This PR was prepared with AI assistance (Claude).
🤖 Generated with Claude Code