Avoid stack overflow on drop of deep AST#479
Open
samuelcolvin wants to merge 1 commit into
Open
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Results 📊❌ Patch coverage is 77.05%. Project has 24059 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 66.36% 66.39% +0.03%
==========================================
Files 281 281 —
Lines 71521 71573 +52
Branches 153638 153776 +138
==========================================
+ Hits 47460 47514 +54
- Misses 24061 24059 -2
- Partials 4067 4066 -1Generated by Codecov Action |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
uses #25480
Summary by cubic
Prevents stack overflow when dropping very deep Python ASTs by severing recursive edges before drop. Deeply nested expressions now return a safe “Source is too deeply nested” error instead of crashing.
Bug Fixes
mem::replaceonBinOp,Call,Subscript, andAttribute, with placeholders to vacate owned fields.deconstruct_subscript,deconstruct_attribute,placeholder_expr,placeholder_arguments.many_plustest to stress deep binary chains; both this and deep attribute access now fail safely with the expected error.Dependencies
ruff_*andty_*crates (e.g.,ruff_python_parser,ruff_python_ast,ruff_text_size,ruff_db,ty_python_semantic,ty_python_core,ty_module_resolver,ty_vendored) to the latest revision.Written for commit 8d0092d. Summary will update on new commits.