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
gh-95185: Check recursion depth in the AST constructor #95186
Conversation
95853f4
to
3057a67
Compare
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
|
A similar issue didn't get backported to 3.9 #25634 |
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 |
…H-95186) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit 00474472944944b346d8409cfded84bb299f601a) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
GH-95208 is a backport of this pull request to the 3.11 branch. |
|
Sorry, @pablogsal, I could not cleanly backport this to |
…ythonGH-95186) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>. (cherry picked from commit 0047447) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
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