summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-01-11 18:20:13 (GMT)
committerGitHub <noreply@github.com>2018-01-11 18:20:13 (GMT)
commit782d6fe4434381c50e0c7ec94a1ef9c6debbc333 (patch)
tree400569ac3175f3e9f40c967da58fafc6df1be5eb /Lib/test/test_compile.py
parent0a2da50e1867831251fad75377d0f10713eb6301 (diff)
downloadcpython-782d6fe4434381c50e0c7ec94a1ef9c6debbc333.zip
cpython-782d6fe4434381c50e0c7ec94a1ef9c6debbc333.tar.gz
cpython-782d6fe4434381c50e0c7ec94a1ef9c6debbc333.tar.bz2
bpo-31113: Get rid of recursion in the compiler for normal control flow. (#3015)
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 29aa362..4617a12 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -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