004-07-10 Bryce McKinlay <mckinlay@redhat.com>
authorBryce McKinlay <mckinlay@redhat.com>
Sat, 10 Jul 2004 15:53:40 +0000 (15:53 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Sat, 10 Jul 2004 15:53:40 +0000 (16:53 +0100)
        * class.c (common_enclosing_context_p): Remove statement with no
        side-effects.

From-SVN: r84460

gcc/java/ChangeLog
gcc/java/class.c

index fea2c218baf5b005a673bf41eb3993f3251ddd2e..6934f07c55fb21452046e222030e0ed5f4b10dc1 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-10  Bryce McKinlay  <mckinlay@redhat.com>
+
+       * class.c (common_enclosing_context_p): Remove statement with no
+       side-effects.
+
 2004-07-09  Bryce McKinlay  <mckinlay@redhat.com>
 
        PR java/8618
index 1273b62155f465bdc2f368c9947a1bcad08b07e0..abadbd1c504afba962d943dc1c8624330a1579f2 100644 (file)
@@ -594,9 +594,7 @@ enclosing_context_p (tree type1, tree type2)
 int
 common_enclosing_context_p (tree type1, tree type2)
 {
-  for (type1; type1; 
-       type1 = (INNER_CLASS_TYPE_P (type1) ?
-               TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1))) : NULL_TREE))
+  while (type1)
     {
       tree current;
       for (current = type2; current;
@@ -605,6 +603,11 @@ common_enclosing_context_p (tree type1, tree type2)
                      NULL_TREE))
        if (type1 == current)
          return 1;
+
+      if (INNER_CLASS_TYPE_P (type1))
+        type1 = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1)));
+      else
+        break;
     }
   return 0;
 }