@@ -9,45 +9,46 @@ extern "C" {
99#endif
1010
1111typedef struct {
12- int b_type ; /* what kind of block this is */
13- int b_handler ; /* where to jump to find handler */
14- int b_level ; /* value stack level to pop to */
12+ int b_type ; /* what kind of block this is */
13+ int b_handler ; /* where to jump to find handler */
14+ int b_level ; /* value stack level to pop to */
1515} PyTryBlock ;
1616
1717typedef struct _frame {
1818 PyObject_VAR_HEAD
19- struct _frame * f_back ; /* previous frame, or NULL */
20- PyCodeObject * f_code ; /* code segment */
21- PyObject * f_builtins ; /* builtin symbol table (PyDictObject) */
22- PyObject * f_globals ; /* global symbol table (PyDictObject) */
23- PyObject * f_locals ; /* local symbol table (any mapping) */
24- PyObject * * f_valuestack ; /* points after the last local */
19+ struct _frame * f_back ; /* previous frame, or NULL */
20+ PyCodeObject * f_code ; /* code segment */
21+ PyObject * f_builtins ; /* builtin symbol table (PyDictObject) */
22+ PyObject * f_globals ; /* global symbol table (PyDictObject) */
23+ PyObject * f_locals ; /* local symbol table (any mapping) */
24+ PyObject * * f_valuestack ; /* points after the last local */
2525 /* Next free slot in f_valuestack. Frame creation sets to f_valuestack.
2626 Frame evaluation usually NULLs it, but a frame that yields sets it
2727 to the current stack top. */
2828 PyObject * * f_stacktop ;
29- PyObject * f_trace ; /* Trace function */
30-
31- /* In a generator, we need to be able to swap between the exception
32- state inside the generator and the exception state of the calling
33- frame (which shouldn't be impacted when the generator "yields"
34- from an except handler).
35- These three fields exist exactly for that, and are unused for
36- non-generator frames. See the SAVE_EXC_STATE and SWAP_EXC_STATE
37- macros in ceval.c for details of their use. */
29+ PyObject * f_trace ; /* Trace function */
30+ PyObject * f_yieldfrom ; /* Iterator being delegated to by yield from */
31+
32+ /* In a generator, we need to be able to swap between the exception
33+ state inside the generator and the exception state of the calling
34+ frame (which shouldn't be impacted when the generator "yields"
35+ from an except handler).
36+ These three fields exist exactly for that, and are unused for
37+ non-generator frames. See the SAVE_EXC_STATE and SWAP_EXC_STATE
38+ macros in ceval.c for details of their use. */
3839 PyObject * f_exc_type , * f_exc_value , * f_exc_traceback ;
3940
4041 PyThreadState * f_tstate ;
41- int f_lasti ; /* Last instruction if called */
42+ int f_lasti ; /* Last instruction if called */
4243 /* Call PyFrame_GetLineNumber() instead of reading this field
4344 directly. As of 2.3 f_lineno is only valid when tracing is
4445 active (i.e. when f_trace is set). At other times we use
4546 PyCode_Addr2Line to calculate the line from the current
4647 bytecode index. */
47- int f_lineno ; /* Current line number */
48- int f_iblock ; /* index in f_blockstack */
48+ int f_lineno ; /* Current line number */
49+ int f_iblock ; /* index in f_blockstack */
4950 PyTryBlock f_blockstack [CO_MAXBLOCKS ]; /* for try and loop blocks */
50- PyObject * f_localsplus [1 ]; /* locals+stack, dynamically sized */
51+ PyObject * f_localsplus [1 ]; /* locals+stack, dynamically sized */
5152} PyFrameObject ;
5253
5354
0 commit comments