summaryrefslogtreecommitdiff
path: root/numpy/array_api/_elementwise_functions.py
diff options
context:
space:
mode:
authorHood Chatham <roberthoodchatham@gmail.com>2022-01-16 09:38:29 -0800
committerHood Chatham <roberthoodchatham@gmail.com>2022-01-16 09:56:27 -0800
commit072253d217502f27e575beed75db83b8216e5b90 (patch)
tree7fd61f1f392962e25fff33d02a8ad7c5a2f790ac /numpy/array_api/_elementwise_functions.py
parent4b985e2b85c7efc1d976835f74c3e45315c5ae28 (diff)
downloadnumpy-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/_elementwise_functions.py')
0 files changed, 0 insertions, 0 deletions