1 --- Modules/_ctypes/libffi/src/x86/ffi64.c
2 +++ Modules/_ctypes/libffi/src/x86/ffi64.c
4 tramp = (volatile unsigned short *) &closure->tramp[0];
6 tramp[0] = 0xbb49; /* mov <code>, %r11 */
7 - *((unsigned long long * volatile) &tramp[1])
8 - = (unsigned long) ffi_closure_unix64;
9 + tramp[1] = (unsigned long) ffi_closure_unix64;
10 + tramp[2] = ((unsigned long) ffi_closure_unix64) >> 16;
11 + tramp[3] = ((unsigned long) ffi_closure_unix64) >> 32;
12 + tramp[4] = ((unsigned long) ffi_closure_unix64) >> 48;
13 tramp[5] = 0xba49; /* mov <data>, %r10 */
14 - *((unsigned long long * volatile) &tramp[6])
15 - = (unsigned long) codeloc;
16 + tramp[6] = (unsigned long) codeloc;
17 + tramp[7] = ((unsigned long) codeloc) >> 16;
18 + tramp[8] = ((unsigned long) codeloc) >> 32;
19 + tramp[9] = ((unsigned long) codeloc) >> 48;
21 /* Set the carry bit iff the function uses any sse registers.
22 This is clc or stc, together with the first byte of the jmp. */
23 --- Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
24 +++ Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
26 tramp = (volatile unsigned short*)&closure->tramp[0];
28 tramp[0] = 0xbb49; /* mov <code>, %r11 */
29 - *(void* volatile*)&tramp[1] = ffi_closure_unix64;
30 + tramp[1] = (unsigned short) ffi_closure_unix64;
31 + tramp[2] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 16);
32 + tramp[3] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 32);
33 + tramp[4] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 48);
34 tramp[5] = 0xba49; /* mov <data>, %r10 */
35 - *(void* volatile*)&tramp[6] = closure;
36 + tramp[6] = (unsigned short) closure;
37 + tramp[7] = (unsigned short) (((unsigned long)closure) >> 16);
38 + tramp[8] = (unsigned short) (((unsigned long)closure) >> 32);
39 + tramp[9] = (unsigned short) (((unsigned long)closure) >> 48);
41 /* Set the carry bit if the function uses any sse registers.
42 This is clc or stc, together with the first byte of the jmp. */