re GNATS gcj/162 (gcj does not initialize interfaces according to spec)
authorTom Tromey <tromey@cygnus.com>
Fri, 26 May 2000 01:16:20 +0000 (01:16 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 26 May 2000 01:16:20 +0000 (01:16 +0000)
* parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
when trying to see if field's class should be initialized.  Always
initialize field's declaring class, not qualified class.
For PR gcj/162.

From-SVN: r34182

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

index fefc0344e83e307d36d103c256e8577633f6e283..c1f0371357ddd5c7ffa20a69db9e2fb5fd91c484 100644 (file)
@@ -1,5 +1,10 @@
 2000-05-25  Tom Tromey  <tromey@cygnus.com>
 
+       * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
+       when trying to see if field's class should be initialized.  Always
+       initialize field's declaring class, not qualified class.
+       For PR gcj/162.
+
        * parse.y (array_constructor_check_entry): Pass `wfl_value', not
        `wfl_operator', to maybe_build_primttype_type_ref.
        Fixes PR gcj/235.
index c89c2d24e375ce82d51a20ea9a558c1d821509d6..17b8f23bdd703fe698746d139a4d70442d4faad1 100644 (file)
@@ -11236,7 +11236,6 @@ resolve_field_access (qual_wfl, field_decl, field_type)
       is_static = JDECL_P (decl) && FIELD_STATIC (decl);
       if (FIELD_FINAL (decl) 
          && JPRIMITIVE_TYPE_P (TREE_TYPE (decl))
-         && DECL_LANG_SPECIFIC (decl)
          && DECL_INITIAL (decl))
        {
          field_ref = DECL_INITIAL (decl);
@@ -11250,7 +11249,7 @@ resolve_field_access (qual_wfl, field_decl, field_type)
        return error_mark_node;
       if (is_static && !static_final_found 
          && !flag_emit_class_files && !flag_emit_xref)
-       field_ref = build_class_init (type_found, field_ref);
+       field_ref = build_class_init (DECL_CONTEXT (decl), field_ref);
     }
   else
     field_ref = decl;
index 317d1f89cbc9e730b6b01e74b5cfa3569209f446..f504544b269f15f5b6bf030a9b349a19423c5afb 100644 (file)
@@ -8604,7 +8604,6 @@ resolve_field_access (qual_wfl, field_decl, field_type)
       is_static = JDECL_P (decl) && FIELD_STATIC (decl);
       if (FIELD_FINAL (decl) 
          && JPRIMITIVE_TYPE_P (TREE_TYPE (decl))
-         && DECL_LANG_SPECIFIC (decl)
          && DECL_INITIAL (decl))
        {
          field_ref = DECL_INITIAL (decl);
@@ -8618,7 +8617,7 @@ resolve_field_access (qual_wfl, field_decl, field_type)
        return error_mark_node;
       if (is_static && !static_final_found 
          && !flag_emit_class_files && !flag_emit_xref)
-       field_ref = build_class_init (type_found, field_ref);
+       field_ref = build_class_init (DECL_CONTEXT (decl), field_ref);
     }
   else
     field_ref = decl;