This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libffi: fix powerpc support for functions with many arguments


This fixes a bug in the handling of functions with many arguments when
the register space overflows.

Andreas.

2009-11-27  Andreas Schwab  <schwab@linux-m68k.org>

	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
	when a float argument is passed in memory.
	(ffi_closure_helper_SYSV): Mark general registers as used up when
	a 64bit or soft-float long double argument is passed in memory.

Index: libffi/src/powerpc/ffi.c
===================================================================
--- libffi/src/powerpc/ffi.c	(revision 154702)
+++ libffi/src/powerpc/ffi.c	(working copy)
@@ -185,6 +185,7 @@ ffi_prep_args_SYSV (extended_cif *ecif,
 	    {
 	      *next_arg.f = (float) double_tmp;
 	      next_arg.u += 1;
+	      intarg_count++;
 	    }
 	  else
 	    *fpr_base.d++ = double_tmp;
@@ -1149,6 +1150,7 @@ ffi_closure_helper_SYSV (ffi_closure *cl
 		pst++;
 	      avalue[i] = pst;
 	      pst += 2;
+	      ng = 8;
 	    }
 	  break;
 
@@ -1222,6 +1224,7 @@ ffi_closure_helper_SYSV (ffi_closure *cl
 		{
 		  avalue[i] = pst;
 		  pst += 4;
+		  ng = 8;
 		}
 	      break;
 	    }

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]