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
On wasm targets, test_code fails. It's because of a bad function pointer cast. The problematic code is as follows:
RequestCodeExtraIndex.restype=ctypes.c_ssize_tSetExtra=py._PyCode_SetExtraSetExtra.argtypes= (ctypes.py_object, ctypes.c_ssize_t, ctypes.c_voidp)
# Verify that the provided free function gets invoked# when the code object is cleaned up.f=eval('lambda:42')
SetExtra(f.__code__, FREE_INDEX, ctypes.c_voidp(100))
The problem: freefunc = ctypes.CFUNCTYPE(None, ctypes.c_voidp) declares a function with signature int f(void*). However, the definition of freefunc is void f(void*). These function signatures do not agree, and trying to make the call crashes.
Due to a bug(?) ctypes can produce closures that have void return type but it can't produce simple functions with void return type.