summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-11-14 12:36:21 (GMT)
committerGitHub <noreply@github.com>2019-11-14 12:36:21 (GMT)
commit4d231bcc77ac8ce7d11bda0804130dcdd678f710 (patch)
tree5cb1019d966e2e29977430b0824d11ccf8bd24e4 /Python/ceval.c
parentb9e681261cd5ce6db0a79461c58d7cc52cfa4902 (diff)
downloadcpython-4d231bcc77ac8ce7d11bda0804130dcdd678f710.zip
cpython-4d231bcc77ac8ce7d11bda0804130dcdd678f710.tar.gz
cpython-4d231bcc77ac8ce7d11bda0804130dcdd678f710.tar.bz2
bpo-38644: Add _PyObject_Call() (GH-17089)
* Add pycore_call.h internal header file. * Add _PyObject_Call(): PyObject_Call() with tstate * Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate * Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict() with tstate * _PyObject_Call_Prepend() now takes tstate * Replace _PyObject_FastCall() calls with _PyObject_VectorcallTstate() calls
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 046cd69..11d25a5 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -10,6 +10,7 @@
#define PY_LOCAL_AGGRESSIVE
#include "Python.h"
+#include "pycore_call.h"
#include "pycore_ceval.h"
#include "pycore_code.h"
#include "pycore_object.h"
@@ -4306,7 +4307,6 @@ fail: /* Jump here from prelude on failure */
current Python frame (f), the associated C stack is still in use,
so recursion_depth must be boosted for the duration.
*/
- assert(tstate != NULL);
if (Py_REFCNT(f) > 1) {
Py_DECREF(f);
_PyObject_GC_TRACK(f);
@@ -5024,10 +5024,11 @@ do_call_core(PyThreadState *tstate, PyObject *func, PyObject *callargs, PyObject
return NULL;
}
- C_TRACE(result, _PyObject_FastCallDict(func,
- &_PyTuple_ITEMS(callargs)[1],
- nargs - 1,
- kwdict));
+ C_TRACE(result, _PyObject_FastCallDictTstate(
+ tstate, func,
+ &_PyTuple_ITEMS(callargs)[1],
+ nargs - 1,
+ kwdict));
Py_DECREF(func);
return result;
}