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

miss-islington webhook-mailer at python.org
Tue Nov 8 16:16:38 EST 2022


https://github.com/python/cpython/commit/1565db7020be2ed66c2777897c3f54974828baf5
commit: 1565db7020be2ed66c2777897c3f54974828baf5
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022年11月08日T13:16:28-08:00
summary:
gh-94445: add compiler test for another case of excessive stack use (GH-99237)
(cherry picked from commit 027bc7e6bba93777c80300953579266818d339e7)
Co-authored-by: Carl Meyer <carl at oddbird.net>
files:
M Lib/test/test_compile.py
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 23f84b48fac8..54e90663ab51 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -1394,6 +1394,13 @@ def test_stack_3050(self):
 # 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /