Message361824
I propose to change PyVectorcall_NARGS() return type from unsigned size_t to signed Py_ssize_t.
Currently, the function is defined as:
static inline Py_ssize_t
PyVectorcall_NARGS(size_t n)
{
return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET;
}
But in CPython code base, the result is always stored in a *signed* Py_ssize_t:
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
Sometimes, this nargs is passed to _PyObject_MakeTpCall() which expects nargs to be Py_ssize_t, so it's consistent.
In general in CPython, a size uses type Py_ssize_t, not size_t. Example: PyVarObject.ob_size type is Py_ssize_t. |
|
Date |
User |
Action |
Args |
2020-02-11 16:50:02 | vstinner | set | recipients:
+ vstinner, petr.viktorin, jdemeyer |
2020-02-11 16:50:02 | vstinner | set | messageid: <1581439802.08.0.269605929245.issue39611@roundup.psfhosted.org> |
2020-02-11 16:50:02 | vstinner | link | issue39611 messages |
2020-02-11 16:50:01 | vstinner | create | |
|