diff options
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r-- | gcc/java/expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index b08d33e..26cd7da 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -2837,7 +2837,12 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index) 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 (); |