]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94445: add compiler test for another case of excessive stack use (GH-99237)
authorCarl Meyer <carl@oddbird.net>
Tue, 8 Nov 2022 20:39:32 +0000 (14:39 -0600)
committerGitHub <noreply@github.com>
Tue, 8 Nov 2022 20:39:32 +0000 (20:39 +0000)
Lib/test/test_compile.py

index 27f91dbcd63aa5e5a022cd3f32214d0591ee32ea..f7847a35181ea32923d2771d45c6b0c27bb6efcc 100644 (file)
@@ -1645,6 +1645,13 @@ class TestExpressionStackSize(unittest.TestCase):
         # 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