Commit 870a5b8a by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

re PR java/4366 (java class initialization bug)

2001-09-20  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (patch_method_invocation): Build class initialization
	when static finals are used to qualify method invocation.
	Fixes PR java/4366.

( http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00880.html )

From-SVN: r45743
parent e5eac8ef
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
(build_dtable_decl): Likewise. (build_dtable_decl): Likewise.
* expr.c (build_invokevirtual): Likewise. * expr.c (build_invokevirtual): Likewise.
2001-09-20 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_method_invocation): Build class initialization
when static finals are used to qualify method invocation.
Fixes PR java/4366.
2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com> 2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.h: (WFL_STRIP_BRACKET): Re-written using * parse.h: (WFL_STRIP_BRACKET): Re-written using
......
...@@ -10096,6 +10096,12 @@ patch_method_invocation (patch, primary, where, from_super, ...@@ -10096,6 +10096,12 @@ patch_method_invocation (patch, primary, where, from_super,
qualify_ambiguous_name (wfl); qualify_ambiguous_name (wfl);
resolved = resolve_field_access (wfl, NULL, NULL); resolved = resolve_field_access (wfl, NULL, NULL);
if (TREE_CODE (resolved) == VAR_DECL && FIELD_STATIC (resolved)
&& FIELD_FINAL (resolved)
&& !inherits_from_p (DECL_CONTEXT (resolved), current_class)
&& !flag_emit_class_files && !flag_emit_xref)
resolved = build_class_init (DECL_CONTEXT (resolved), resolved);
if (resolved == error_mark_node) if (resolved == error_mark_node)
PATCH_METHOD_RETURN_ERROR (); PATCH_METHOD_RETURN_ERROR ();
......
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