re PR java/21844 (miscompilation of LinkedHashMap)
authorTom Tromey <tromey@redhat.com>
Mon, 13 Jun 2005 19:20:22 +0000 (19:20 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Mon, 13 Jun 2005 19:20:22 +0000 (19:20 +0000)
PR java/21844:
* parse.y (nested_field_access_p): Handle case where outer field
is inherited by enclosing class.

From-SVN: r100893

gcc/java/ChangeLog
gcc/java/parse.y

index c16e1ef849bc10958e5e6b80148481cde12cfc6d..52196e49a36316de63eea1e24c179d182fab9e34 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-13  Tom Tromey  <tromey@redhat.com>
+
+       PR java/21844:
+       * parse.y (nested_field_access_p): Handle case where outer field
+       is inherited by enclosing class.
+
 2005-06-12  Per Bothner  <per@bothner.com>
 
        * class.c (inherits_from_p): Do load_class if needed.
index ebaede8ab12862f1e999b6939bc7f9a30e0502cf..11087192bec588e30fe91eb7a344b8612a549cfc 100644 (file)
@@ -8389,13 +8389,6 @@ nested_field_access_p (tree type, tree decl)
     {
       if (type_root == decl_type)
         return 1;
-
-      /* Before we give up, see whether it is a non-static field
-         inherited from the enclosing context we are considering.  */
-      if (!DECL_CONTEXT (TYPE_NAME (type_root))
-          && !is_static
-          && inherits_from_p (type_root, decl_type))
-        return 1;
     }
 
   if (TREE_CODE (decl_type) == RECORD_TYPE
@@ -8416,6 +8409,13 @@ nested_field_access_p (tree type, tree decl)
   if (type_root == decl_type_root)
     return 1;
 
+  /* Before we give up, see whether it is a non-static field
+     inherited from the enclosing context we are considering.  */
+  if (!DECL_CONTEXT (TYPE_NAME (type_root))
+      && !is_static
+      && inherits_from_p (type_root, decl_type))
+    return 1;
+
   return 0;
 }