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

This commit is contained in:
Carl Meyer 2022-11-08 14:39:32 -06:00 committed by GitHub
parent 0b4ffb08cc
commit 027bc7e6bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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