gh-106905: Use separate structs to track recursion depth in each PyAST_mod2obj call. - #113035
Conversation
…on depths in PyAST_mod2obj.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Wait, so ast_state is a global state? Ah, now I see the mistake.
|
Thanks @yilei for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
|
Sorry, @yilei and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @yilei and @serhiy-storchaka, I could not cleanly backport this to |
… in each PyAST_mod2obj call. (pythonGH-113035) (cherry picked from commit 48c4973) Co-authored-by: Yilei Yang <yileiyang@google.com> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
|
GH-113472 is a backport of this pull request to the 3.12 branch. |
…n depth in each PyAST_mod2obj call. (pythonGH-113035) (pythonGH-113472) (cherry picked from commit 48c4973) (cherry picked from commit d58a5f4) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Yilei Yang <yileiyang@google.com> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
…h PyAST_mod2obj call. (pythonGH-113035) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
…h PyAST_mod2obj call. (pythonGH-113035) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
…h PyAST_mod2obj call. (pythonGH-113035) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
…h PyAST_mod2obj call. (pythonGH-113035) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
This avoids a race condition in
PyAST_mod2objwhen the GIL could be released due to GC (on Python 3.11).This should fix #106905.