[Python-checkins] gh-94445: add compiler test for another case of excessive stack use (GH-99237)

iritkatriel webhook-mailer at python.org
Tue Nov 8 15:39:38 EST 2022


https://github.com/python/cpython/commit/027bc7e6bba93777c80300953579266818d339e7
commit: 027bc7e6bba93777c80300953579266818d339e7
branch: main
author: Carl Meyer <carl at oddbird.net>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2022-11-08T20:39:32Z
summary:

gh-94445: add compiler test for another case of excessive stack use (GH-99237)

files:
M Lib/test/test_compile.py

diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 27f91dbcd63a..f7847a35181e 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -1645,6 +1645,13 @@ def test_stack_3050(self):
         # This raised on 3.10.0 to 3.10.5
         compile(code, "<foo>", "single")
 
+    def test_stack_3050_2(self):
+        M = 3050
+        args = ", ".join(f"arg{i}:type{i}" for i in range(M))
+        code = f"def f({args}):\n  pass"
+        # This raised on 3.10.0 to 3.10.5
+        compile(code, "<foo>", "single")
+
 
 class TestStackSizeStability(unittest.TestCase):
     # Check that repeating certain snippets doesn't increase the stack size



More information about the Python-checkins mailing list