Repository navigation
fix(import-manim): bound every recursive parser production - #232
Merged
Merged
Conversation
The Python parser only counted bracket, unary and power nesting. Assignment chains, `:=`, conditional expressions, `lambda` and nested blocks recursed without a bound, and `statement()` reset the counter for every statement, so a hostile script could exhaust the stack inside the importer sandbox. Count depth on all of them, keep it across nested statements, and test each construct. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
Open
MemerGamer
added a commit
that referenced
this pull request
Nov 14, 2026
statement_inner recursed once per 'async' token without a depth check, so 'async async ...' could still exhaust the importer sandbox's stack after #232. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up from the plugin API 1.1 agent (#230), which left this commit on a branch without a PR.
The new pure-Rust Python parser (replacing tree-sitter for wasm32) bounded only some recursive productions, and
statement()reset the depth counter for each statement, so a hostile Manim script could exhaust the stack inside the importer sandbox. Depth is now counted on every recursive production and kept across nested statements, with a test per construct.cargo test -p animathio-import-manimpasses (34 tests).🤖 Generated with Claude Code