code += " x and x\n" * self.N
self.check_stack_size(code)
+ def test_stack_3050(self):
+ M = 3050
+ code = "x," * M + "=t"
+ # 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
Py_DECREF(consts);
goto error;
}
- if (maxdepth > MAX_ALLOWED_STACK_USE) {
- PyErr_Format(PyExc_SystemError,
- "excessive stack use: stack is %d deep",
- maxdepth);
- Py_DECREF(consts);
- goto error;
- }
co = PyCode_NewWithPosOnlyArgs(posonlyargcount+posorkeywordargcount,
posonlyargcount, kwonlyargcount, nlocals_int,
maxdepth, flags, a->a_bytecode, consts, names,