Commit e5dce82f by Ulrich Weigand Committed by Ulrich Weigand

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
parent 578d1468
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> 2004-06-30 Geoffrey Keating <geoffk@apple.com>
* src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
/*====================================================================*/ /*====================================================================*/
static void ffi_prep_args (unsigned char *, extended_cif *); static void ffi_prep_args (unsigned char *, extended_cif *);
static int ffi_check_float_struct (ffi_type *);
void void
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
__attribute__ ((visibility ("hidden"))) __attribute__ ((visibility ("hidden")))
...@@ -222,15 +221,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif) ...@@ -222,15 +221,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
} }
} }
/* Pointers are passed like UINTs of the same size. */ /* Now handle all primitive int/pointer/float data types. */
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. */
switch (type) switch (type)
{ {
case FFI_TYPE_DOUBLE: case FFI_TYPE_DOUBLE:
...@@ -251,6 +242,13 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif) ...@@ -251,6 +242,13 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
else else
p_ov[n_ov++] = *(unsigned int *) arg; p_ov[n_ov++] = *(unsigned int *) arg;
break; 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_UINT64:
case FFI_TYPE_SINT64: case FFI_TYPE_SINT64:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment