summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-11-10 12:34:57 (GMT)
committerGitHub <noreply@github.com>2022-11-10 12:34:57 (GMT)
commit1e197e63e21f77b102ff2601a549dda4b6439455 (patch)
tree5d8524091404607c838bb9a0ea168c8d9c28fd6a /Misc/NEWS.d
parentdbf2faf579b4094387d65ee41f049456ca67c446 (diff)
downloadcpython-1e197e63e21f77b102ff2601a549dda4b6439455.zip
cpython-1e197e63e21f77b102ff2601a549dda4b6439455.tar.gz
cpython-1e197e63e21f77b102ff2601a549dda4b6439455.tar.bz2
GH-96421: Insert shim frame on entry to interpreter (GH-96319)
* Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
Diffstat (limited to 'Misc/NEWS.d')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2022-10-19-15-59-08.gh-issue-96421.e22y3r.rst13
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.
+