diff options
author | Alexandre Petit-Bianco <apbianco@redhat.com> | 2001-09-21 22:03:35 -0700 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2001-09-21 22:03:35 -0700 |
commit | 870a5b8a905c9beb84ba07dd3dc5297bd00b47cf (patch) | |
tree | ce02214a3f412baa56820b7257afbab217b7a5f3 /gcc/java/parse.y | |
parent | e5eac8efac636afeb0bef8df817cd7d8b54445f4 (diff) | |
download | gcc-870a5b8a905c9beb84ba07dd3dc5297bd00b47cf.zip gcc-870a5b8a905c9beb84ba07dd3dc5297bd00b47cf.tar.gz gcc-870a5b8a905c9beb84ba07dd3dc5297bd00b47cf.tar.bz2 |
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
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 0c8953e..9a0656a 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -10096,6 +10096,12 @@ patch_method_invocation (patch, primary, where, from_super, qualify_ambiguous_name (wfl); 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) PATCH_METHOD_RETURN_ERROR (); |