gh-95185: Check recursion depth in the AST constructor#95186
gh-95185: Check recursion depth in the AST constructor#95186pablogsal merged 3 commits intopython:mainfrom
Conversation
95853f4 to
3057a67
Compare
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
|
A similar issue didn't get backported to 3.9 #25634 |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
|
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
|
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 <storchaka@gmail.com>. (cherry picked from commit 0047447) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
@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. |
Closes: #95185