diff options
| author | Hood Chatham <roberthoodchatham@gmail.com> | 2022-01-16 09:38:29 -0800 |
|---|---|---|
| committer | Hood Chatham <roberthoodchatham@gmail.com> | 2022-01-16 09:56:27 -0800 |
| commit | 072253d217502f27e575beed75db83b8216e5b90 (patch) | |
| tree | 7fd61f1f392962e25fff33d02a8ad7c5a2f790ac /numpy/array_api/_statistical_functions.py | |
| parent | 4b985e2b85c7efc1d976835f74c3e45315c5ae28 (diff) | |
| download | numpy-072253d217502f27e575beed75db83b8216e5b90.tar.gz | |
BUG: Fix comparator function signatures
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:
258ce2523ffad99be69afbd421d540086cb6bf61
23c05e6f1b392f80f749dbb4668b5e7b52aef014
Diffstat (limited to 'numpy/array_api/_statistical_functions.py')
0 files changed, 0 insertions, 0 deletions
