gh-120834: fix type of *_iframe field in _PyGenObject_HEAD declaration (#120835)

This commit is contained in:
Irit Katriel 2024-06-24 10:23:38 +01:00 committed by GitHub
parent c38e2f64d0
commit 65a12c559c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 81 additions and 79 deletions

View file

@ -1338,7 +1338,7 @@ static bool frame_is_suspended(PyFrameObject *frame)
{
assert(!_PyFrame_IsIncomplete(frame->f_frame));
if (frame->f_frame->owner == FRAME_OWNED_BY_GENERATOR) {
PyGenObject *gen = _PyFrame_GetGenerator(frame->f_frame);
PyGenObject *gen = _PyGen_GetGeneratorFromFrame(frame->f_frame);
return FRAME_STATE_SUSPENDED(gen->gi_frame_state);
}
return false;
@ -1665,7 +1665,7 @@ static PyObject *
frame_clear(PyFrameObject *f, PyObject *Py_UNUSED(ignored))
{
if (f->f_frame->owner == FRAME_OWNED_BY_GENERATOR) {
PyGenObject *gen = _PyFrame_GetGenerator(f->f_frame);
PyGenObject *gen = _PyGen_GetGeneratorFromFrame(f->f_frame);
if (gen->gi_frame_state == FRAME_EXECUTING) {
goto running;
}
@ -2097,7 +2097,7 @@ PyFrame_GetGenerator(PyFrameObject *frame)
if (frame->f_frame->owner != FRAME_OWNED_BY_GENERATOR) {
return NULL;
}
PyGenObject *gen = _PyFrame_GetGenerator(frame->f_frame);
PyGenObject *gen = _PyGen_GetGeneratorFromFrame(frame->f_frame);
return Py_NewRef(gen);
}