summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-30 10:28:59 (GMT)
committerGitHub <noreply@github.com>2023-06-30 10:28:59 (GMT)
commit80b3d8f337bef52d7c360b4ee86be873681f747a (patch)
tree5cf0667bbac5e0d67e7551479218f2090ff3f799 /Python
parentf3cf2ddd8ddc7dfa6b06e6da640391a1bcd62b8a (diff)
downloadcpython-80b3d8f337bef52d7c360b4ee86be873681f747a.zip
cpython-80b3d8f337bef52d7c360b4ee86be873681f747a.tar.gz
cpython-80b3d8f337bef52d7c360b4ee86be873681f747a.tar.bz2
gh-106023: Remove _PyObject_FastCallTstate() function (#106273)
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 8e3fbe3..56d771f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -979,12 +979,6 @@ static PyObject *
call_trampoline(PyThreadState *tstate, PyObject* callback,
PyFrameObject *frame, int what, PyObject *arg)
{
-
- PyObject *stack[3];
- stack[0] = (PyObject *)frame;
- stack[1] = whatstrings[what];
- stack[2] = (arg != NULL) ? arg : Py_None;
-
/* Discard any previous modifications the frame's fast locals */
if (frame->f_fast_as_locals) {
if (PyFrame_FastToLocalsWithError(frame) < 0) {
@@ -993,7 +987,11 @@ call_trampoline(PyThreadState *tstate, PyObject* callback,
}
/* call the Python-level function */
- PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3);
+ if (arg == NULL) {
+ arg = Py_None;
+ }
+ PyObject *args[3] = {(PyObject *)frame, whatstrings[what], arg};
+ PyObject *result = _PyObject_VectorcallTstate(tstate, callback, args, 3, NULL);
PyFrame_LocalsToFast(frame, 1);
return result;