re PR java/15734 (internal compiler error: Segmentation fault)
authorBryce McKinlay <mckinlay@redhat.com>
Sat, 26 Jun 2004 20:42:01 +0000 (20:42 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Sat, 26 Jun 2004 20:42:01 +0000 (21:42 +0100)
PR java/15734
* expr.c (expand_java_field_op): Ensure that target class for static
field access has been loaded.

From-SVN: r83720

gcc/java/ChangeLog
gcc/java/expr.c

index 9ed01a6fc1504a505546b206070893aa8dd59e19..7193e1a8b7fec038c652998f81f9dbeea5c020ad 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-26  Bryce McKinlay  <mckinlay@redhat.com>
+
+       PR java/15734
+       * expr.c (expand_java_field_op): Ensure that target class for static
+       field access has been loaded.
+
 2004-06-26  Bryce McKinlay  <mckinlay@redhat.com>
            Ranjit Mathew  <rmathew@hotmail.com>
 
index 446f8afe2db45907a6f0e4f62a070bfd6809987a..d4f25f89d66cf1ef237acd14a46573d3f7ac6258 100644 (file)
@@ -2375,7 +2375,11 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index)
   tree new_value = is_putting ? pop_value (field_type) : NULL_TREE;
   tree field_ref;
   int is_error = 0;
-  tree field_decl = lookup_field (&self_type, field_name);
+  tree field_decl;
+  
+  if (! CLASS_LOADED_P (self_type))
+    load_class (self_type, 1);  
+  field_decl = lookup_field (&self_type, field_name);
   if (field_decl == error_mark_node)
     {
       is_error = 1;