Fix pushes_fd method signature#5833
Conversation
|
I also removed all of the PyObject *
get_some_attr(SpecificTypeOfObject *decoder, void *closure)whereas the first argument is expected to be a Probably it's better to put the casts back, but it's unfortunate that we can't get better type safety here -- it's so easy to mess up these signatures. |
|
It is indeed generating a bunch of warnings - https://github.com/python-pillow/Pillow/runs/4202395176#step:9:26
|
|
Okay I put the casts back. |
|
Please could you rebase or redo those two commits, to clean the history up a little bit? One way: git reset --soft HEAD~2
git push --force |
Getters are supposed to have signature "PyObject *(PyObject *self, void *closure)", but the closure argument is often not used. In wasm it causes a trap if a function is declared with one argument and then called with two.
b083f13 to
7a93328
Compare
|
Thanks! |
Python getters are supposed to take a
void* closureargument.I am coming from Pyodide. Web assembly has no native support for function pointer casting -- a function declared with a certain signature must be called with the same signature, or it will fail with
RuntimeError: function signature mismatch. Emscripten has support for emulating function pointer casts which we are currently using, but it imposes a significant performance and stack space cost and we are trying to remove the pointer cast emulation pyodide/pyodide#1677. To do this, we need to patch Python packages so that they have function signatures that match the calling conventions they declare.