ffi.c (ffi_prep_args): Fix C aliasing violation.

* src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation.
	(ffi_check_float_struct): Remove unused prototype.

From-SVN: r84505
This commit is contained in:
Ulrich Weigand 2004-07-11 11:45:39 +00:00 committed by Ulrich Weigand
parent 578d146841
commit e5dce82f98
2 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2004-07-11 Ulrich Weigand <uweigand@de.ibm.com>
* src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation.
(ffi_check_float_struct): Remove unused prototype.
2004-06-30 Geoffrey Keating <geoffk@apple.com>
* src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment

View File

@ -69,7 +69,6 @@
/*====================================================================*/
static void ffi_prep_args (unsigned char *, extended_cif *);
static int ffi_check_float_struct (ffi_type *);
void
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
__attribute__ ((visibility ("hidden")))
@ -222,15 +221,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
}
}
/* Pointers are passed like UINTs of the same size. */
if (type == FFI_TYPE_POINTER)
#ifdef __s390x__
type = FFI_TYPE_UINT64;
#else
type = FFI_TYPE_UINT32;
#endif
/* Now handle all primitive int/float data types. */
/* Now handle all primitive int/pointer/float data types. */
switch (type)
{
case FFI_TYPE_DOUBLE:
@ -251,6 +242,13 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
else
p_ov[n_ov++] = *(unsigned int *) arg;
break;
case FFI_TYPE_POINTER:
if (n_gpr < MAX_GPRARGS)
p_gpr[n_gpr++] = (unsigned long)*(unsigned char **) arg;
else
p_ov[n_ov++] = (unsigned long)*(unsigned char **) arg;
break;
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64: