[libffi] More x86_64 bugs

Andrew Haley aph@redhat.com
Mon Jan 13 17:55:00 GMT 2003


libffi gets confused with void return type on x86_64.  With this
patch, all CNI tests pass.

Now down to 14 unexpected failures on libgcj.

Andrew.


2003-01-10    <aph@.redhat.com>

        * src/x86/unix64.S: Add unwind info.

Index: src/x86/ffi64.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/src/x86/ffi64.c,v
retrieving revision 1.2
diff -u -r1.2 ffi64.c
--- src/x86/ffi64.c     2 Oct 2002 06:21:54 -0000       1.2
+++ src/x86/ffi64.c     13 Jan 2003 17:49:37 -0000
@@ -285,7 +285,8 @@
   /* First check if the return value should be passed in memory. If so,
      pass the pointer as the first argument.  */
   gprcount = ssecount = 0;
-  if (examine_argument (ecif->cif->rtype, 1, &g, &s) == 0)
+  if (ecif->cif->rtype->type != FFI_TYPE_VOID
+      && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0)
     (void *)stack->gpr[gprcount++] = ecif->rvalue;

   for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue;
@@ -389,8 +390,8 @@

   /* If the return value should be passed in memory, pass the pointer
      as the first argument. The actual memory isn't allocated here.  */
-
-  if (examine_argument (cif->rtype, 1, &g, &s) == 0)
+  if (cif->rtype->type != FFI_TYPE_VOID
+      && examine_argument (cif->rtype, 1, &g, &s) == 0)
     gprcount = 1;

   /* Go over all arguments and determine the way they should be passed.



More information about the Java-patches mailing list