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]

java/13273: Fix regression


A side effect of my patch for 13273 is that RHUG builds stopped
working.

This was because name lookups no longer had the side effect of reading
all a class's superinterfaces, and this exposed a latent bug where
check_interface_throws_clauses() didn't make sure an interface had
been loaded before checking its methods.

This patch is for trunk and branch.

Regtested x86_64-redhat-linux-gnu.

Andrew.



2004-01-27  Andrew Haley  <aph@redhat.com>

	java/13273
	* parse.y (check_interface_throws_clauses): Make sure class_decl
	has been loaded.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.464
diff -c -2 -p -r1.464 parse.y
*** parse.y	9 Jan 2004 17:08:44 -0000	1.464
--- parse.y	27 Jan 2004 14:25:54 -0000
*************** check_interface_throws_clauses (tree che
*** 6486,6493 ****
    for (; class_decl != NULL_TREE; class_decl = CLASSTYPE_SUPER (class_decl))
      {
!       tree bases = TYPE_BINFO_BASETYPES (class_decl);
!       int iface_len = TREE_VEC_LENGTH (bases) - 1;
        int i;
  
        for (i = iface_len; i > 0; --i)
  	{
--- 6486,6503 ----
    for (; class_decl != NULL_TREE; class_decl = CLASSTYPE_SUPER (class_decl))
      {
!       tree bases;
!       int iface_len;
        int i;
  
+       if (! CLASS_LOADED_P (class_decl))
+ 	{
+ 	  if (CLASS_FROM_SOURCE_P (class_decl))
+ 	    safe_layout_class (class_decl);
+ 	  else
+ 	    load_class (class_decl, 1);
+ 	}
+ 
+       bases = TYPE_BINFO_BASETYPES (class_decl);
+       iface_len = TREE_VEC_LENGTH (bases) - 1;
        for (i = iface_len; i > 0; --i)
  	{


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