summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_frame.h')
-rw-r--r--Include/internal/pycore_frame.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h
index 856297a..20d48d2 100644
--- a/Include/internal/pycore_frame.h
+++ b/Include/internal/pycore_frame.h
@@ -61,7 +61,13 @@ typedef struct _PyInterpreterFrame {
// over, or (in the case of a newly-created frame) a totally invalid value:
_Py_CODEUNIT *prev_instr;
int stacktop; /* Offset of TOS from localsplus */
- uint16_t yield_offset;
+ /* The return_offset determines where a `RETURN` should go in the caller,
+ * relative to `prev_instr`.
+ * It is only meaningful to the callee,
+ * so it needs to be set in any CALL (to a Python function)
+ * or SEND (to a coroutine or generator).
+ * If there is no callee, then it is meaningless. */
+ uint16_t return_offset;
char owner;
/* Locals and stack */
PyObject *localsplus[1];
@@ -121,7 +127,7 @@ _PyFrame_Initialize(
frame->stacktop = code->co_nlocalsplus;
frame->frame_obj = NULL;
frame->prev_instr = _PyCode_CODE(code) - 1;
- frame->yield_offset = 0;
+ frame->return_offset = 0;
frame->owner = FRAME_OWNED_BY_THREAD;
for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {