This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[4.0/4.1 Regression] BC-compiled interfaces in libgcj can't be called from non-BC code


This regression is because the compiler and the runtime lay out
interface dispatch tables differently.  The compiler assumes that an
IDT contains every method in an interface including those in
superinterfaces, whereas the runtime only populates those in the
declaring interface.

This is for all 4.x gcc versions.

Andrew.


2005-10-12  Andrew Haley  <aph@redhat.com>

	PR java/24251
	* link.cc (ensure_method_table_complete): Install Miranda methods
	for interfaces too.

Index: link.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/link.cc,v
retrieving revision 1.17
diff -u -r1.17 link.cc
--- link.cc     17 Aug 2005 20:43:59 -0000      1.17
+++ link.cc     12 Oct 2005 09:32:48 -0000
@@ -1548,11 +1548,12 @@
 void
 _Jv_Linker::ensure_method_table_complete (jclass klass)
 {
-  if (klass->vtable != NULL || klass->isInterface())
+  if (klass->vtable != NULL)
     return;
 
   // We need our superclass to have its own Miranda methods installed.
-  wait_for_state (klass->getSuperclass (), JV_STATE_LOADED);
+  if (! klass->isInterface())
+    wait_for_state (klass->getSuperclass (), JV_STATE_LOADED);
 
   // A class might have so-called "Miranda methods".  This is a method
   // that is declared in an interface and not re-declared in an


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