mirror of
https://github.com/python/cpython.git
synced 2025-10-13 18:33:34 +00:00
GH-118093: Improve handling of short and mid-loop traces (GH-122252)
This commit is contained in:
parent
78df1043db
commit
7797182b78
2 changed files with 34 additions and 35 deletions
|
@ -342,8 +342,9 @@ _PyGen_yf(PyGenObject *gen)
|
|||
{
|
||||
if (gen->gi_frame_state == FRAME_SUSPENDED_YIELD_FROM) {
|
||||
_PyInterpreterFrame *frame = &gen->gi_iframe;
|
||||
assert(is_resume(frame->instr_ptr));
|
||||
assert((frame->instr_ptr->op.arg & RESUME_OPARG_LOCATION_MASK) >= RESUME_AFTER_YIELD_FROM);
|
||||
// GH-122390: These asserts are wrong in the presence of ENTER_EXECUTOR!
|
||||
// assert(is_resume(frame->instr_ptr));
|
||||
// assert((frame->instr_ptr->op.arg & RESUME_OPARG_LOCATION_MASK) >= RESUME_AFTER_YIELD_FROM);
|
||||
return PyStackRef_AsPyObjectNew(_PyFrame_StackPeek(frame));
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue