GH-93897: Store frame size in code object and de-opt if insufficient space on thread frame stack. (GH-93908)

This commit is contained in:
Mark Shannon 2022-06-20 12:59:25 +01:00 committed by GitHub
parent 774ef28814
commit 45e62a2bc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 67 deletions

View file

@ -858,8 +858,9 @@ init_frame(_PyInterpreterFrame *frame, PyFunctionObject *func, PyObject *locals)
{
/* _PyFrame_InitializeSpecials consumes reference to func */
Py_INCREF(func);
Py_XINCREF(locals);
PyCodeObject *code = (PyCodeObject *)func->func_code;
_PyFrame_InitializeSpecials(frame, func, locals, code->co_nlocalsplus);
_PyFrame_InitializeSpecials(frame, func, locals, code);
for (Py_ssize_t i = 0; i < code->co_nlocalsplus; i++) {
frame->localsplus[i] = NULL;
}