re PR java/17586 (kawa build fails with ICE)
authorAndrew Haley <aph@redhat.com>
Tue, 28 Sep 2004 17:40:56 +0000 (17:40 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Tue, 28 Sep 2004 17:40:56 +0000 (17:40 +0000)
2004-09-28  Andrew Haley  <aph@redhat.com>

PR java/17586
* jcf-parse.c (load_class): Don't try to read a class that we've
already read.

From-SVN: r88239

gcc/java/ChangeLog
gcc/java/jcf-parse.c

index a9438f5ae2c2fe9dc4e47aeb9c6f0902090e042a..eaf591e58b61ed8a636bf7706d926d99515a098a 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-28  Andrew Haley  <aph@redhat.com>
+
+       PR java/17586
+       * jcf-parse.c (load_class): Don't try to read a class that we've
+       already read.
+
 2004-09-28  Andrew Haley  <aph@redhat.com>
 
        * jcf-parse.c (load_class): Back out previous broken patch.
index bc733e84f53eb18d8562a99e6b8ef92eb76c6216..e1a4bab88c9d3f232174156d1e67e8cd632a8dd1 100644 (file)
@@ -567,6 +567,7 @@ load_class (tree class_or_name, int verbose)
 {
   tree name, saved;
   int class_loaded;
+  tree class_decl;
 
   /* class_or_name can be the name of the class we want to load */
   if (TREE_CODE (class_or_name) == IDENTIFIER_NODE)
@@ -577,12 +578,12 @@ load_class (tree class_or_name, int verbose)
     name = TYPE_NAME (TREE_PURPOSE (class_or_name));
   /* Or it's a type in the making */
   else
-    {
-      /* If the class is from source code, then it must already be loaded.  */
-      if (CLASS_FROM_SOURCE_P (class_or_name))
-        return;
-      name = DECL_NAME (TYPE_NAME (class_or_name));
-    }
+    name = DECL_NAME (TYPE_NAME (class_or_name));
+
+  /* If the class is from source code, then it must already be loaded.  */
+  class_decl = IDENTIFIER_CLASS_VALUE (name);
+  if (class_decl && CLASS_FROM_SOURCE_P (TREE_TYPE (class_decl)))
+    return;
 
   saved = name;
   while (1)