From bb4ef3eb505aca65f97a498681a17baf58e53484 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Mon, 7 Nov 2022 22:09:56 -0800 Subject: [PATCH] add compiler test for another case of excessive stack use --- Lib/test/test_compile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 27f91dbcd63aa5..f7847a35181ea3 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, "", "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, "", "single") + class TestStackSizeStability(unittest.TestCase): # Check that repeating certain snippets doesn't increase the stack size