The comparator functions are expected to have signature int f(void *, void*, PyArrayObject *).
Some of the comparators drop the third argument because they don't use them. Because the
comparators are unused, with most architectures this works fine. However, calling a function
pointer that has been cast to have a different number of arguments is undefined in the C
specification. With web assembly targets, it crashes at runtime.
This fixes the comparators defined in arraytypes.c.src to all take three arguments.
See also related work:
258ce25
23c05e6
Backport of #20833.
The comparator functions are expected to have signature int f(void *, void*, PyArrayObject *).
Some of the comparators drop the third argument because they don't use them. Because the
comparators are unused, with most architectures this works fine. However, calling a function
pointer that has been cast to have a different number of arguments is undefined in the C
specification. With web assembly targets, it crashes at runtime.
This fixes the comparators defined in arraytypes.c.src to all take three arguments.
See also related work:
258ce25
23c05e6