diff options
Diffstat (limited to 'gcc-4.7/libffi/src/x86/ffi64.c')
-rw-r--r-- | gcc-4.7/libffi/src/x86/ffi64.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc-4.7/libffi/src/x86/ffi64.c b/gcc-4.7/libffi/src/x86/ffi64.c index bd907d720..41c4e776b 100644 --- a/gcc-4.7/libffi/src/x86/ffi64.c +++ b/gcc-4.7/libffi/src/x86/ffi64.c @@ -426,7 +426,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) /* If the return value is passed in memory, add the pointer as the first integer argument. */ if (ret_in_memory) - reg_args->gpr[gprcount++] = (long) rvalue; + reg_args->gpr[gprcount++] = (unsigned long) rvalue; avn = cif->nargs; arg_types = cif->arg_types; @@ -501,9 +501,11 @@ ffi_prep_closure_loc (ffi_closure* closure, tramp = (volatile unsigned short *) &closure->tramp[0]; tramp[0] = 0xbb49; /* mov <code>, %r11 */ - *(void * volatile *) &tramp[1] = ffi_closure_unix64; + *((unsigned long long * volatile) &tramp[1]) + = (unsigned long) ffi_closure_unix64; tramp[5] = 0xba49; /* mov <data>, %r10 */ - *(void * volatile *) &tramp[6] = codeloc; + *((unsigned long long * volatile) &tramp[6]) + = (unsigned long) codeloc; /* Set the carry bit iff the function uses any sse registers. This is clc or stc, together with the first byte of the jmp. */ @@ -542,7 +544,7 @@ ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue, { /* The return value goes in memory. Arrange for the closure return value to go directly back to the original caller. */ - rvalue = (void *) reg_args->gpr[gprcount++]; + rvalue = (void *) (unsigned long) reg_args->gpr[gprcount++]; /* We don't have to do anything in asm for the return. */ ret = FFI_TYPE_VOID; } |