Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
According to the docs, the signature of `tp_new` should be: `PyObject* tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)` https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_new We don't care about the arguments, but according to the C standard 6.3.2.3.8 this is undefined behavior: > A pointer to a function of one type may be converted to a pointer to a > function of another type and back again; the result shall compare equal to > the original pointer. If a converted pointer is used to call a function whose > type is not compatible with the pointed-to type, the behavior is undefined. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf#page=60 In normal platforms the behavior is to work as expected, but in WebAssembly, this crashes. Fixes pyodide/pyodide#5015.
- Loading branch information