You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Fixespyodide/pyodide#5015.
0 commit comments