-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-95185: Check recursion depth in the AST constructor #95186
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
Conversation
95853f4
to
3057a67
Compare
Signed-off-by: Pablo Galindo <[email protected]>
A similar issue didn't get backported to 3.9 #25634 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the code is generated and functions only have one exit on failure, you can add state->recursion_depth--
also for failure, and check the balance on failure too, as in symtable, etc.
I did not decremented the recursion depth on failure in ast_opt because functions there have multiple failure exits, so it would complicate the code. But in this case it will complicate the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case LGTM.
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]> Signed-off-by: Pablo Galindo <[email protected]>
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
…H-95186) Co-authored-by: Serhiy Storchaka <[email protected]> (cherry picked from commit 0047447) Co-authored-by: Pablo Galindo Salgado <[email protected]>
GH-95208 is a backport of this pull request to the 3.11 branch. |
Sorry, @pablogsal, I could not cleanly backport this to |
GH-95209 is a backport of this pull request to the 3.10 branch. |
…ythonGH-95186) Co-authored-by: Serhiy Storchaka <[email protected]>. (cherry picked from commit 0047447) Co-authored-by: Pablo Galindo Salgado <[email protected]> Signed-off-by: Pablo Galindo <[email protected]>
@pablogsal, since you aborted backporting GH-95186 (this PR) to 3.10 due to the ABI change, do you still think I should be backporting GH-25634, which I aborted due to ABI changes? |
The ABI is changing but I don't think is in a way that can break things in extension modules. It may break profilers and debuggers thought. |
…) (GH-95208) Co-authored-by: Serhiy Storchaka <[email protected]> (cherry picked from commit 0047447) Co-authored-by: Pablo Galindo Salgado <[email protected]>
Closes: #95185