diff options
author | Mark Shannon <mark@hotpy.org> | 2021-11-29 12:34:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-29 12:34:59 (GMT) |
commit | 60929576e40038ec71d896230f69e4411c82be4b (patch) | |
tree | 34dc24d0a73ef0205514202820d66c152260dc22 /Python/ceval.c | |
parent | 7431448b817d3bf87f71661cf8f3d537807ab2e2 (diff) | |
download | cpython-60929576e40038ec71d896230f69e4411c82be4b.zip cpython-60929576e40038ec71d896230f69e4411c82be4b.tar.gz cpython-60929576e40038ec71d896230f69e4411c82be4b.tar.bz2 |
bpo-45786: Allocate space for frame in frame object. (GH-29729)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 9beb1a4..0427361 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5694,7 +5694,8 @@ make_coro_frame(PyThreadState *tstate, } assert(frame->frame_obj == NULL); if (initialize_locals(tstate, func, frame->localsplus, args, argcount, kwnames)) { - _PyFrame_Clear(frame, 1); + _PyFrame_Clear(frame); + PyMem_Free(frame); return NULL; } return frame; @@ -5750,7 +5751,7 @@ _PyEvalFramePushAndInit(PyThreadState *tstate, PyFunctionObject *func, localsarray[i] = NULL; } if (initialize_locals(tstate, func, localsarray, args, argcount, kwnames)) { - _PyFrame_Clear(frame, 0); + _PyFrame_Clear(frame); return NULL; } return frame; @@ -5773,11 +5774,8 @@ static int _PyEvalFrameClearAndPop(PyThreadState *tstate, InterpreterFrame * frame) { --tstate->recursion_remaining; - assert(frame->frame_obj == NULL || frame->frame_obj->f_own_locals_memory == 0); - if (_PyFrame_Clear(frame, 0)) { - ++tstate->recursion_remaining; - return -1; - } + assert(frame->frame_obj == NULL || frame->frame_obj->f_owns_frame == 0); + _PyFrame_Clear(frame); ++tstate->recursion_remaining; _PyThreadState_PopFrame(tstate, frame); return 0; |