PR java/28754:
* expr.c (expand_java_field_op): Initialize field's declaring
interface if necessary.
From-SVN: r116890
2006-09-12 Tom Tromey <tromey@redhat.com>
+ PR java/28754:
+ * expr.c (expand_java_field_op): Initialize field's declaring
+ interface if necessary.
+
+2006-09-12 Tom Tromey <tromey@redhat.com>
+
PR java/28892:
* expr.c (expand_java_field_op): No error for assignments not in
class initializer or constructor.
field_ref = build_field_ref (field_ref, self_type, field_name);
if (is_static
&& ! flag_indirect_dispatch)
- field_ref = build_class_init (self_type, field_ref);
+ {
+ tree context = DECL_CONTEXT (field_ref);
+ if (context != self_type && CLASS_INTERFACE (TYPE_NAME (context)))
+ field_ref = build_class_init (context, field_ref);
+ field_ref = build_class_init (self_type, field_ref);
+ }
if (is_putting)
{
flush_quick_stack ();