summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-06-20 11:59:25 (GMT)
committerGitHub <noreply@github.com>2022-06-20 11:59:25 (GMT)
commit45e62a2bc1c0000e2e9b613fff6bebf2c26fcb93 (patch)
tree2fb6748705e118b6a3cd9264f6b946bcfa06e5e5 /Objects/frameobject.c
parent774ef28814d0d9d57ec813cb31b0a7af6c476127 (diff)
downloadcpython-45e62a2bc1c0000e2e9b613fff6bebf2c26fcb93.zip
cpython-45e62a2bc1c0000e2e9b613fff6bebf2c26fcb93.tar.gz
cpython-45e62a2bc1c0000e2e9b613fff6bebf2c26fcb93.tar.bz2
GH-93897: Store frame size in code object and de-opt if insufficient space on thread frame stack. (GH-93908)
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 545c1b6..94bd245 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -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;
}