diff options
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2022-10-19-15-59-08.gh-issue-96421.e22y3r.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-10-19-15-59-08.gh-issue-96421.e22y3r.rst b/Misc/NEWS.d/next/Core and Builtins/2022-10-19-15-59-08.gh-issue-96421.e22y3r.rst new file mode 100644 index 0000000..857ce7d --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-10-19-15-59-08.gh-issue-96421.e22y3r.rst @@ -0,0 +1,13 @@ +When calling into Python code from C code, through :c:func:`PyEval_EvalFrameEx` or +a related C-API function, a shim frame in inserted into the call stack. +This occurs in the ``_PyEval_EvalFrameDefault()`` function. +The extra frame should be invisible to all Python and most C extensions, +but out-of-process profilers and debuggers need to be aware of it. +These shim frames can be detected by checking +``frame->owner == FRAME_OWNED_BY_CSTACK``. + +Extensions implementing their own interpreters using PEP 523 need to be +aware of this shim frame and the changes to the semantics of +:opcode:`RETURN_VALUE`, :opcode:`YIELD_VALUE`, and :opcode:`RETURN_GENERATOR`, +which now clear the frame. + |