Bug report
Bug description:
The current implementation is relying on restype->size to write the data into a buffer, however, per libffi contract
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.
We have also opened a PR to fix this temporarily under llvm: llvm/llvm-project#221024
CPython versions tested on:
3.11
Operating systems tested on:
Linux
Bug report
Bug description:
The current implementation is relying on
restype->sizeto write the data into a buffer, however, per libffi contractWhich 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.
We have also opened a PR to fix this temporarily under llvm: llvm/llvm-project#221024
CPython versions tested on:
3.11
Operating systems tested on:
Linux