gh-111178: Change Argument Clinic signature for METH_O (#130682)

Use "PyObject*" for METH_O functions to fix an undefined behavior.
This commit is contained in:
Victor Stinner 2025-03-11 16:33:36 +01:00 committed by GitHub
parent 4162bc133b
commit 9d759b63d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 843 additions and 190 deletions

View file

@ -484,7 +484,7 @@ deque_extend_impl(dequeobject *deque, PyObject *iterable)
PyObject *s = PySequence_List(iterable);
if (s == NULL)
return NULL;
result = deque_extend(deque, s);
result = deque_extend((PyObject*)deque, s);
Py_DECREF(s);
return result;
}
@ -578,7 +578,7 @@ deque_inplace_concat(PyObject *self, PyObject *other)
PyObject *result;
// deque_extend is thread-safe
result = deque_extend(deque, other);
result = deque_extend((PyObject*)deque, other);
if (result == NULL)
return result;
Py_INCREF(deque);