diff options
author | Alexandre Petit-Bianco <apbianco@redhat.com> | 2001-06-02 09:44:11 -0700 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2001-06-02 09:44:11 -0700 |
commit | 12e248d6429f601c030512b0174f514400a303fb (patch) | |
tree | c6027774056f9a15398efd2379ac3b9ab51b1d93 /gcc | |
parent | a49bedaa4dbb72a65549e01cd3b21d82e685bbf1 (diff) | |
download | gcc-12e248d6429f601c030512b0174f514400a303fb.zip gcc-12e248d6429f601c030512b0174f514400a303fb.tar.gz gcc-12e248d6429f601c030512b0174f514400a303fb.tar.bz2 |
re PR java/2605 (gcj crashes on .java file containing byte.class.getClass())
2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (type_literals:): Use `build_incomplete_class_ref' with
builtin type.
(patch_incomplete_class_ref): Build the class ref, build the class
init if necessary, complete the tree.
Fixes PR java/2605
(http://gcc.gnu.org/ml/gcc-patches/2001-06/msg00044.html )
From-SVN: r42807
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/java/parse.y | 12 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index f13bfbe..5fc8f8f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,11 @@ +2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com> + + * parse.y (type_literals:): Use `build_incomplete_class_ref' with + builtin type. + (patch_incomplete_class_ref): Build the class ref, build the class + init if necessary, complete the tree. + Fixes PR java/2605 + 2001-05-31 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.y (lookup_field_wrapper): Test `name' code. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 4ae8812..e766479 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -1954,9 +1954,12 @@ type_literals: | array_type DOT_TK CLASS_TK { $$ = build_incomplete_class_ref ($2.location, $1); } | primitive_type DOT_TK CLASS_TK - { $$ = build_class_ref ($1); } + { $$ = build_incomplete_class_ref ($2.location, $1); } | VOID_TK DOT_TK CLASS_TK - { $$ = build_class_ref (void_type_node); } + { + $$ = build_incomplete_class_ref ($2.location, + void_type_node); + } ; class_instance_creation_expression: @@ -13773,8 +13776,11 @@ patch_incomplete_class_ref (node) if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type)) { + tree dot = 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 (!flag_emit_class_files) + dot = build_class_init (ref_type, dot); + return java_complete_tree (dot); } /* If we're emitting class files and we have to deal with non |