[3.10] bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) by miss-islington · Pull Request #26521 · python/cpython
When compiling an AST object with a direct / indirect reference
cycles, on the conversion phase because of exceeding amount of
calls, a segfault was raised. This patch adds recursion guards to
places for preventing user inputs to not to crash AST but instead
raise a RecursionError.
(cherry picked from commit f349124)
Co-authored-by: Batuhan Taskaya batuhan@python.org