Skip to content

Commit b137e18

Browse files
czardozmeta-codesync[bot]
authored andcommitted
Clear awaiter pointers in SEND_GEN
Summary: Inline completed coroutines retain stale awaiter pointers. Fixed it by clearing them Reviewed By: alexmalyshev Differential Revision: D112393428 fbshipit-source-id: 0b86997da373eb245a1137a59762bee2ca78f73c
1 parent 3f2934a commit b137e18

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • cinderx/Interpreter/3.12/Includes

cinderx/Interpreter/3.12/Includes/ceval.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,8 @@ clear_gen_frame(PyThreadState *tstate, _PyInterpreterFrame * frame)
15771577
_PyFrame_ClearExceptCode(frame);
15781578
tstate->c_recursion_remaining++;
15791579
frame->previous = NULL;
1580+
/* Inlined SEND bypasses gen_send_ex2(), so clear the awaiter here. */
1581+
Py_CLEAR(gen->gi_ci_awaiter);
15801582
}
15811583

15821584
static void

0 commit comments

Comments
 (0)