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

(cherry picked from commit 027bc7e6bb)

Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
Miss Islington (bot) 2022-11-08 13:16:28 -08:00 committed by GitHub
parent 00147a84fc
commit 1565db7020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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