diff options
Diffstat (limited to 'ext/ffi_c/libffi/src/ia64/ffi.c')
-rw-r--r-- | ext/ffi_c/libffi/src/ia64/ffi.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ext/ffi_c/libffi/src/ia64/ffi.c b/ext/ffi_c/libffi/src/ia64/ffi.c index 60120ed..b77a836 100644 --- a/ext/ffi_c/libffi/src/ia64/ffi.c +++ b/ext/ffi_c/libffi/src/ia64/ffi.c @@ -1,8 +1,8 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2011 Anthony Green - Copyright (c) 2000 Hewlett Packard Company - Copyright (c) 1998, 2007, 2008 Red Hat, Inc. - + ffi.c - Copyright (c) 1998, 2007, 2008, 2012 Red Hat, Inc. + Copyright (c) 2000 Hewlett Packard Company + Copyright (c) 2011 Anthony Green + IA64 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining @@ -325,13 +325,17 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) case FFI_TYPE_FLOAT: if (gpcount < 8 && fpcount < 8) stf_spill (&stack->fp_regs[fpcount++], *(float *)avalue[i]); - stack->gp_regs[gpcount++] = *(UINT32 *)avalue[i]; + { + UINT32 tmp; + memcpy (&tmp, avalue[i], sizeof (UINT32)); + stack->gp_regs[gpcount++] = tmp; + } break; case FFI_TYPE_DOUBLE: if (gpcount < 8 && fpcount < 8) stf_spill (&stack->fp_regs[fpcount++], *(double *)avalue[i]); - stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i]; + memcpy (&stack->gp_regs[gpcount++], avalue[i], sizeof (UINT64)); break; case FFI_TYPE_LONGDOUBLE: @@ -397,7 +401,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) the closure (in the "trampoline" area), but we replace the gp pointer with a pointer to the closure itself. We also add the real gp pointer to the closure. This allows the function entry code to - both retrieve the user data, and to restire the correct gp pointer. */ + both retrieve the user data, and to restore the correct gp pointer. */ extern void ffi_closure_unix (); |