cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-94445: add compiler test for another case of excessive stack use

Open carljm opened this issue 3 years ago • 1 comments
trafficstars

In GH-94329 the MAX_ALLOWED_STACK_SIZE check in the compiler (added in 3.10.0) was reverted, because it was discovered that a large sequence unpacking could use more than the allowed stack size. A todo comment was left in the code to re-add this check in future, and GH-94445 was created to track the todo item.

I've found another case in which unbounded stack can be consumed: a function with a very large number of type-annotated arguments. This PR simply adds a test for that case, to ensure that if in future the stack-size check is again enforced, the case won't be missed and cause another breakage for valid (if pathological) code.

carljm avatar Nov 08 '22 06:11 carljm

All commit authors signed the Contributor License Agreement.
CLA signed

cpython-cla-bot[bot] avatar Nov 08 '22 06:11 cpython-cla-bot[bot]

Thanks @carljm for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. 🐍🍒⛏🤖

miss-islington avatar Nov 08 '22 20:11 miss-islington

GH-99262 is a backport of this pull request to the 3.11 branch.

bedevere-bot avatar Nov 08 '22 20:11 bedevere-bot