[ecj] Patch: FYI: fix PR java/28089
Tom Tromey
tromey@redhat.com
Wed Jun 21 18:37:00 GMT 2006
I'm checking this in on the gcj-eclipse branch.
This fixes a bug in how we pick which class to initialize when
referencing a static field when compiling bytecode using the C++ ABI.
We want to initialize the field's declaring class -- not the
qualifying class.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
PR java/28089:
* expr.c (expand_java_field_op): Initialize field's declaring
class.
Index: expr.c
===================================================================
--- expr.c (revision 114816)
+++ expr.c (working copy)
@@ -2804,9 +2804,11 @@
}
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);
+ if (is_static && ! flag_indirect_dispatch)
+ {
+ /* Initialize the declaring class of the field. */
+ field_ref = build_class_init (DECL_CONTEXT (field_ref), field_ref);
+ }
if (is_putting)
{
flush_quick_stack ();
More information about the Gcc-patches
mailing list