]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94445: add compiler test for another case of excessive stack use (GH-99237)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 8 Nov 2022 21:16:28 +0000 (13:16 -0800)
committerGitHub <noreply@github.com>
Tue, 8 Nov 2022 21:16:28 +0000 (13:16 -0800)
(cherry picked from commit 027bc7e6bba93777c80300953579266818d339e7)

Co-authored-by: Carl Meyer <carl@oddbird.net>
Lib/test/test_compile.py

index 23f84b48fac830d31c197027ff33baef0781ded1..54e90663ab51000dc38609eb2eb860e3c838adf1 100644 (file)
@@ -1394,6 +1394,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