mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
GH-100126: Skip incomplete frames in more places (GH-100613)
This commit is contained in:
parent
2e80c2a976
commit
61762b9387
12 changed files with 62 additions and 46 deletions
|
|
@ -166,6 +166,21 @@ _PyFrame_IsIncomplete(_PyInterpreterFrame *frame)
|
|||
frame->prev_instr < _PyCode_CODE(frame->f_code) + frame->f_code->_co_firsttraceable;
|
||||
}
|
||||
|
||||
static inline _PyInterpreterFrame *
|
||||
_PyFrame_GetFirstComplete(_PyInterpreterFrame *frame)
|
||||
{
|
||||
while (frame && _PyFrame_IsIncomplete(frame)) {
|
||||
frame = frame->previous;
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
static inline _PyInterpreterFrame *
|
||||
_PyThreadState_GetFrame(PyThreadState *tstate)
|
||||
{
|
||||
return _PyFrame_GetFirstComplete(tstate->cframe->current_frame);
|
||||
}
|
||||
|
||||
/* For use by _PyFrame_GetFrameObject
|
||||
Do not call directly. */
|
||||
PyFrameObject *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue