mirror of
https://github.com/python/cpython.git
synced 2026-02-13 19:04:37 +00:00
bpo-44114: Fix dictkeys_reversed and dictvalues_reversed function signatures (GH-26062)
These are passed and called as PyCFunction, however they are defined here without the (ignored) args parameter.
This works fine in some C compilers, but fails in webassembly or anything else that has strict function pointer call type checking.
(cherry picked from commit ab383eb6f0)
Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
This commit is contained in:
parent
6275ea0282
commit
7cbe6ca634
2 changed files with 5 additions and 4 deletions
|
|
@ -0,0 +1 @@
|
|||
Fix incorrect dictkeys_reversed and dictitems_reversed function signatures in C code, which broke webassembly builds.
|
||||
|
|
@ -4826,7 +4826,7 @@ static PySequenceMethods dictitems_as_sequence = {
|
|||
(objobjproc)dictitems_contains, /* sq_contains */
|
||||
};
|
||||
|
||||
static PyObject* dictitems_reversed(_PyDictViewObject *dv);
|
||||
static PyObject* dictitems_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored));
|
||||
|
||||
PyDoc_STRVAR(reversed_items_doc,
|
||||
"Return a reverse iterator over the dict items.");
|
||||
|
|
@ -4879,7 +4879,7 @@ dictitems_new(PyObject *dict, PyObject *Py_UNUSED(ignored))
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
dictitems_reversed(_PyDictViewObject *dv)
|
||||
dictitems_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
if (dv->dv_dict == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
|
|
@ -4909,7 +4909,7 @@ static PySequenceMethods dictvalues_as_sequence = {
|
|||
(objobjproc)0, /* sq_contains */
|
||||
};
|
||||
|
||||
static PyObject* dictvalues_reversed(_PyDictViewObject *dv);
|
||||
static PyObject* dictvalues_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored));
|
||||
|
||||
PyDoc_STRVAR(reversed_values_doc,
|
||||
"Return a reverse iterator over the dict values.");
|
||||
|
|
@ -4960,7 +4960,7 @@ dictvalues_new(PyObject *dict, PyObject *Py_UNUSED(ignored))
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
dictvalues_reversed(_PyDictViewObject *dv)
|
||||
dictvalues_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
if (dv->dv_dict == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue