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]

[gcjx] Patch: FYI: fix interface list


I'm checking this in on the gcjx branch.

This fixes constructor used to list the interfaces in a Class object.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* classobj.cc (handle_interfaces): Correctly set up constructor.

Index: classobj.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/classobj.cc,v
retrieving revision 1.1.2.17
diff -u -r1.1.2.17 classobj.cc
--- classobj.cc 8 Mar 2005 01:22:00 -0000 1.1.2.17
+++ classobj.cc 9 Mar 2005 01:50:56 -0000
@@ -329,11 +329,12 @@
 	   i != ifaces.end ();
 	   ++i)
 	{
-	  ++len;
 	  gcj_abi *abi = builtins->find_abi ();
 	  tree one_iface = abi->build_class_reference (builtins, klass,
 						       (*i)->type ());
-	  result = tree_cons (NULL_TREE, one_iface, result);
+	  result = tree_cons (build_int_cst (type_jint, len), one_iface,
+			      result);
+	  ++len;
 	}
       result = nreverse (result);
 
@@ -343,7 +344,9 @@
       tree type_interface_array = build_array_type (type_class_ptr,
 						    type_index);
 
-      interfaces = make_decl (type_interface_array, result);
+      interfaces = make_decl (type_interface_array,
+			      build_constructor (type_interface_array,
+						 result));
     }
 
   iface_len = build_int_cst (type_jshort, len);


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