bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)

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 f3491242e4)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
This commit is contained in:
Miss Islington (bot) 2021-06-03 13:27:00 -07:00 committed by GitHub
parent d2ab15f537
commit 976598d36b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 840 additions and 4 deletions

808
Python/Python-ast.c generated

File diff suppressed because it is too large Load diff