diff options
author | Tom Tromey <tromey@cygnus.com> | 2000-06-25 17:25:31 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2000-06-25 17:25:31 +0000 |
commit | f1ff439a50500c09c7f8016ca00dfe0bfd1109a2 (patch) | |
tree | d63d1f1e6cd319b39df884faaac61ea0f7642909 /gcc | |
parent | 6d77b53e7a196f01fc03bb481a7cb574213a4a6d (diff) | |
download | gcc-f1ff439a50500c09c7f8016ca00dfe0bfd1109a2.zip gcc-f1ff439a50500c09c7f8016ca00dfe0bfd1109a2.tar.gz gcc-f1ff439a50500c09c7f8016ca00dfe0bfd1109a2.tar.bz2 |
re GNATS gcj/260 ("Klass.class" expression should cause Klass to be initialized)
* parse.y (patch_incomplete_class_ref): Initialize the returned
class. For PR gcj/260.
From-SVN: r34695
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/parse.c | 9 | ||||
-rw-r--r-- | gcc/java/parse.y | 5 |
3 files changed, 15 insertions, 4 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 70b26f0..5b0e1a6 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2000-06-23 Tom Tromey <tromey@cygnus.com> + + * parse.y (patch_incomplete_class_ref): Initialize the returned + class. For PR gcj/260. + 2000-06-21 Alexandre Petit-Bianco <apbianco@cygnus.com> * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'. diff --git a/gcc/java/parse.c b/gcc/java/parse.c index 415d877..d6ece50 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -211,7 +211,7 @@ static tree lookup_method_invoke PARAMS ((int, tree, tree, tree, tree)); static tree register_incomplete_type PARAMS ((int, tree, tree, tree)); static tree obtain_incomplete_type PARAMS ((tree)); static tree java_complete_lhs PARAMS ((tree)); -tree java_complete_tree PARAMS ((tree)); +static tree java_complete_tree PARAMS ((tree)); static tree maybe_generate_pre_expand_clinit PARAMS ((tree)); static int maybe_yank_clinit PARAMS ((tree)); static void java_complete_expand_method PARAMS ((tree)); @@ -13280,7 +13280,7 @@ breakdown_qualified (left, right, source) local variable decls if present. Same as java_complete_lhs, but does resolve static finals to values. */ -tree +static tree java_complete_tree (node) tree node; { @@ -15690,7 +15690,10 @@ patch_incomplete_class_ref (node) return error_mark_node; if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type)) - return build_class_ref (ref_type); + { + /* A class referenced by `foo.class' is initialized. */ + return build_class_init (ref_type, build_class_ref (ref_type)); + } /* If we're emitting class files and we have to deal with non primitive types, we invoke (and consider generating) the diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 3cf2df4..3e0f83e 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -12992,7 +12992,10 @@ patch_incomplete_class_ref (node) return error_mark_node; if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type)) - return build_class_ref (ref_type); + { + /* A class referenced by `foo.class' is initialized. */ + return build_class_init (ref_type, build_class_ref (ref_type)); + } /* If we're emitting class files and we have to deal with non primitive types, we invoke (and consider generating) the |