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
{{ message }}
Repository navigation
_ctypes fails to extend the return value per libffi contract #156933
integral types narrower than the system register size are widened
Which is not happening here. This has caused a failure on s390x when using libclang. cindex.py calls into libclang through ctypes, which builds the callback closures using libffi. With a c_int return, ctypes writes only the low 32 bits and skips the extension that both the ABI and libffi's closure contract require.
Activity
ZeroIntensity commentedon Sep 5, 2026
Would you like to submit a PR?
miladfarca commentedon Sep 25, 2026
There is already a PR submitted which seems to pass the single test case I have shared there.
gh-156933: Widen narrow integer results in `ctypes` callbacks (GH-157045
[3.13] gh-156933: Widen narrow integer results in `ctypes` callbacks (G…
[3.14] gh-156933: Widen narrow integer results in `ctypes` callbacks (G…
ZeroIntensity commentedon Sep 27, 2026
3.15 backport will be merged separately. Thanks @miladfarca and @lazerg for the fix!
[3.15] gh-156933: Widen narrow integer results in `ctypes` callbacks (G…