Skip to content

Commit 1565db7

Browse files
gh-94445: add compiler test for another case of excessive stack use (GH-99237)
(cherry picked from commit 027bc7e) Co-authored-by: Carl Meyer <[email protected]>
1 parent 00147a8 commit 1565db7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_compile.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,13 @@ def test_stack_3050(self):
13941394
# This raised on 3.10.0 to 3.10.5
13951395
compile(code, "<foo>", "single")
13961396

1397+
def test_stack_3050_2(self):
1398+
M = 3050
1399+
args = ", ".join(f"arg{i}:type{i}" for i in range(M))
1400+
code = f"def f({args}):\n pass"
1401+
# This raised on 3.10.0 to 3.10.5
1402+
compile(code, "<foo>", "single")
1403+
13971404

13981405
class TestStackSizeStability(unittest.TestCase):
13991406
# Check that repeating certain snippets doesn't increase the stack size

0 commit comments

Comments
 (0)