bpo-31113: Get rid of recursion in the compiler for normal control flow. (#3015)

This commit is contained in:
Serhiy Storchaka 2018-01-11 20:20:13 +02:00 committed by GitHub
parent 0a2da50e18
commit 782d6fe443
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 109 additions and 77 deletions

View file

@ -671,6 +671,11 @@ if 1:
compile("42", PathLike("test_compile_pathlike"), "single")
def test_stack_overflow(self):
# bpo-31113: Stack overflow when compile a long sequence of
# complex statements.
compile("if a: b\n" * 200000, "<dummy>", "exec")
class TestExpressionStackSize(unittest.TestCase):
# These tests check that the computed stack size for a code object