summaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-12 15:55:07 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-12 15:55:07 +0000
commite9725da5926538fd58ec407ae74f56ea70422241 (patch)
tree104cd59776422baa7f42d64413a35b465fdfd18b /gcc/java
parent85386eb7ba6e9a2b1647aaae75235cc96f5dafaf (diff)
downloadgcc-e9725da5926538fd58ec407ae74f56ea70422241.tar.gz
PR java/28754:
* expr.c (expand_java_field_op): Initialize field's declaring interface if necessary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/expr.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index e7508bfbb7b..1df29ccb838 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,11 @@
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.
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index b08d33e9ada..26cd7da5078 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 ();