Repository navigation
feat: set the function-call depth limit at every parse entry point, up to 512 - #255
Merged
Merged
Conversation
…p to 512 Generated SQL can nest function calls deeper than the default limit of 256, and only Rust callers could raise it. The check, convert, run, function and census commands now take --max-call-depth, Python's check and convert take max_call_depth=, and a lint request takes max_function_call_depth, whose default rises from 128 to 256 to match the other entry points. A limit runs from 1 to 512, the parser's fixed nesting ceiling, and a larger one is refused, naming the ceiling. A refusal for nested calls says how to raise the limit for its entry point, and one that meets the ceiling says that no setting raises it. The parser grows its stack as it nests, so a raised limit stays safe. Rust tests on a 256 KiB thread read 256, 300 and 511 levels and refuse 257, 301 and 600 cleanly; CLI, Python and lint tests cover the flag, the keyword, the request field and the hints; and the wheel smoke test reads 511 levels on a small thread on every platform, Windows included.
kvlonge
enabled auto-merge
November 18, 2026 16:11
kvlonge
disabled auto-merge
November 18, 2026 16:40
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.
Why
Generated SQL, such as a macro that nests about 65 REPLACE calls, can go past the library's function-call depth limit, and only Rust callers could raise it. Lint parsed with its own fixed limit of 128. A depth refusal did not say how to raise the limit.
Changes
--max-call-depthoncheck,convert,run,functionandcensus;max_call_depth=on Python'scheckandConvertOptions;max_function_call_depthon a lint request, like a format request.Verification
make check-ci RECORDER=0passes.