summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes/libffi/src/mips/ffi.c
diff options
context:
space:
mode:
authordoko@ubuntu.com <doko@ubuntu.com>2014-08-09 20:36:35 (GMT)
committerdoko@ubuntu.com <doko@ubuntu.com>2014-08-09 20:36:35 (GMT)
commit736a9133219ec75524d90a976d2e35c76d544b6e (patch)
tree90b62b7edfc8782a4d86df52316e43b3aceb42e7 /Modules/_ctypes/libffi/src/mips/ffi.c
parent4f06d604c40f12a1d59e3bfda061f3dd7bce6e45 (diff)
downloadcpython-736a9133219ec75524d90a976d2e35c76d544b6e.zip
cpython-736a9133219ec75524d90a976d2e35c76d544b6e.tar.gz
cpython-736a9133219ec75524d90a976d2e35c76d544b6e.tar.bz2
- Issue #22176: Update the ctypes module's libffi to v3.1. This release
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian architectures.
Diffstat (limited to 'Modules/_ctypes/libffi/src/mips/ffi.c')
-rw-r--r--Modules/_ctypes/libffi/src/mips/ffi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_ctypes/libffi/src/mips/ffi.c b/Modules/_ctypes/libffi/src/mips/ffi.c
index 03121e3..5d0dd70 100644
--- a/Modules/_ctypes/libffi/src/mips/ffi.c
+++ b/Modules/_ctypes/libffi/src/mips/ffi.c
@@ -170,7 +170,14 @@ static void ffi_prep_args(char *stack,
break;
case FFI_TYPE_UINT32:
+#ifdef FFI_MIPS_N32
+ /* The N32 ABI requires that 32-bit integers
+ be sign-extended to 64-bits, regardless of
+ whether they are signed or unsigned. */
+ *(ffi_arg *)argp = *(SINT32 *)(* p_argv);
+#else
*(ffi_arg *)argp = *(UINT32 *)(* p_argv);
+#endif
break;
/* This can only happen with 64bit slots. */