mirror of https://github.com/python/cpython
bpo-46323: Allow alloca(0) for python callback function of ctypes (GH-31249)
This commit is contained in:
parent
dee020a6f5
commit
db052851a7
|
@ -165,11 +165,7 @@ static void _CallPythonObject(void *mem,
|
|||
assert(PyTuple_Check(converters));
|
||||
nargs = PyTuple_GET_SIZE(converters);
|
||||
assert(nargs <= CTYPES_MAX_ARGCOUNT);
|
||||
PyObject **args = NULL;
|
||||
if (nargs > 0) {
|
||||
args = alloca(nargs * sizeof(PyObject *));
|
||||
}
|
||||
|
||||
PyObject **args = alloca(nargs * sizeof(PyObject *));
|
||||
PyObject **cnvs = PySequence_Fast_ITEMS(converters);
|
||||
for (i = 0; i < nargs; i++) {
|
||||
PyObject *cnv = cnvs[i]; // borrowed ref
|
||||
|
|
Loading…
Reference in New Issue