Commit 4b943588 by Tom Tromey Committed by Tom Tromey

re PR java/28754 (java.lang.nullPointerException while accessing final static…

re PR java/28754 (java.lang.nullPointerException while accessing final static members of an interface)

	PR java/28754:
	* expr.c (expand_java_field_op): Initialize field's declaring
	interface if necessary.

From-SVN: r116890
parent 91da2e7c
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.
......
......@@ -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 ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment