diff options
author | Mark Shannon <mark@hotpy.org> | 2021-10-28 12:59:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 12:59:11 (GMT) |
commit | f291404a802d6a1bc50f817c7a26ff3ac9a199ff (patch) | |
tree | 57ad999fe2fb5febf8a48cd17dc213259b80574c /Python/pystate.c | |
parent | 0a68b3603fbc0aaf9eeb8ce8b42b78d6fa7cfa78 (diff) | |
download | cpython-f291404a802d6a1bc50f817c7a26ff3ac9a199ff.zip cpython-f291404a802d6a1bc50f817c7a26ff3ac9a199ff.tar.gz cpython-f291404a802d6a1bc50f817c7a26ff3ac9a199ff.tar.bz2 |
bpo-45637: Store the frame pointer in the cframe (GH-29267)
* Rename 'frame' to 'current_frame'
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 7804e17..114f915 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -636,12 +636,12 @@ new_threadstate(PyInterpreterState *interp, int init) tstate->interp = interp; - tstate->frame = NULL; tstate->recursion_depth = 0; tstate->recursion_headroom = 0; tstate->stackcheck_counter = 0; tstate->tracing = 0; tstate->root_cframe.use_tracing = 0; + tstate->root_cframe.current_frame = NULL; tstate->cframe = &tstate->root_cframe; tstate->gilstate_counter = 0; tstate->async_exc = NULL; @@ -861,7 +861,7 @@ PyThreadState_Clear(PyThreadState *tstate) { int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; - if (verbose && tstate->frame != NULL) { + if (verbose && tstate->cframe->current_frame != NULL) { /* bpo-20526: After the main thread calls _PyRuntimeState_SetFinalizing() in Py_FinalizeEx(), threads must exit when trying to take the GIL. If a thread exit in the middle of @@ -1134,10 +1134,10 @@ PyFrameObject* PyThreadState_GetFrame(PyThreadState *tstate) { assert(tstate != NULL); - if (tstate->frame == NULL) { + if (tstate->cframe->current_frame == NULL) { return NULL; } - PyFrameObject *frame = _PyFrame_GetFrameObject(tstate->frame); + PyFrameObject *frame = _PyFrame_GetFrameObject(tstate->cframe->current_frame); if (frame == NULL) { PyErr_Clear(); } @@ -1277,7 +1277,7 @@ _PyThread_CurrentFrames(void) for (i = runtime->interpreters.head; i != NULL; i = i->next) { PyThreadState *t; for (t = i->tstate_head; t != NULL; t = t->next) { - InterpreterFrame *frame = t->frame; + InterpreterFrame *frame = t->cframe->current_frame; if (frame == NULL) { continue; } |