Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ gen_set_exception(PyObject *typ, PyObject *val, PyObject *tb)
static PyObject *
gen_throw_current_exception(PyGenObject *gen)
{
assert(gen->gi_frame_state == FRAME_EXECUTING);
assert(FT_ATOMIC_LOAD_INT8_RELAXED(gen->gi_frame_state) == FRAME_EXECUTING);

PyObject *result;
if (gen_send_ex2(gen, Py_None, &result, 1) == PYGEN_RETURN) {
Expand Down
2 changes: 1 addition & 1 deletion Python/frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ _PyFrame_ClearExceptCode(_PyInterpreterFrame *frame)
/* It is the responsibility of the owning generator/coroutine
* to have cleared the enclosing generator, if any. */
assert(frame->owner != FRAME_OWNED_BY_GENERATOR ||
_PyGen_GetGeneratorFromFrame(frame)->gi_frame_state == FRAME_CLEARED);
FT_ATOMIC_LOAD_INT8_RELAXED(_PyGen_GetGeneratorFromFrame(frame)->gi_frame_state) == FRAME_CLEARED);
// GH-99729: Clearing this frame can expose the stack (via finalizers). It's
// crucial that this frame has been unlinked, and is no longer visible:
assert(_PyThreadState_GET()->current_frame != frame);
Expand Down
Loading