diff mbox

[libjava] : Fix for PR libgcj/50053

Message ID CAEwic4a7n9GTWh5xRU85uBika26i_BMxrnZ9uS60DEOZq1Hq-w@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Dec. 10, 2011, 12:05 p.m. UTC
Hi,

this patch addresses ABI change about class-member-functions for
32-bit IA Windows native target.  For
it the calling-convention is now __thiscall, as described by
manufactor's ABI description.

ChangeLog

2011-12-10  Kai Tietz  <ktietz@redhat.com>

	PR libgcj/50053
	* java/lang/natClass.cc (java::lang::Class::newInstance): Special case
	member-call for 32-bit IA native Window target.

Tested by user, and I did a regression test for
x86_64-unknown-linux-gnu for it. Ok for apply?

Regards,
Kai

Comments

Andreas Schwab Dec. 10, 2011, 12:10 p.m. UTC | #1
Kai Tietz <ktietz70@googlemail.com> writes:

> +  /* Class constructor/destructor have for 32-bit native Windows ABI
> +     __thiscall calling convention.  */

     /* Class constructors/destructors have __thiscall calling
        convention for 32-bit native Windows ABI.  */

Andreas.
Andrew Haley Dec. 12, 2011, 10:07 a.m. UTC | #2
On 12/10/2011 12:05 PM, Kai Tietz wrote:
> 2011-12-10  Kai Tietz  <ktietz@redhat.com>
> 
> 	PR libgcj/50053
> 	* java/lang/natClass.cc (java::lang::Class::newInstance): Special case
> 	member-call for 32-bit IA native Window target.

OK, thanks.

Andrew.
diff mbox

Patch

Index: natClass.cc
===================================================================
--- natClass.cc (revision 182092)
+++ natClass.cc (working copy)
@@ -661,7 +661,13 @@ 
     throw new java::lang::InstantiationException (getName());

   jobject r = _Jv_AllocObject (this);
+  /* Class constructor/destructor have for 32-bit native Windows ABI
+     __thiscall calling convention.  */
+#if defined (__MINGW32__) && defined (__i386__)
+  ((void (__thiscall *) (jobject)) meth->ncode) (r);
+#else
   ((void (*) (jobject)) meth->ncode) (r);
+#endif
   return r;
 }