From 3b988d6d3cd5e6552a529e4d9f5890c965838d85 Mon Sep 17 00:00:00 2001 From: apbianco Date: Fri, 21 Jul 2000 18:11:52 +0000 Subject: [PATCH] 2000-07-21 Alexandre Petit-Bianco * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node or its first operand can be error marks. 2000-07-20 Alexandre Petit-Bianco * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC. * parse.y (method_header): Likewise. 2000-07-19 Alexandre Petit-Bianco * parse.y (find_as_inner_class): Handle the case where the enclosing context of an innerclass has been loaded as bytecode. (Side gcj/225 bug fix and some cleanup: http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00832.html) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35176 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/ChangeLog | 15 +++++++++++++++ gcc/java/parse.h | 2 +- gcc/java/parse.y | 17 ++++++++++++++--- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index e1b96993844..d8f99ad1e8c 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,18 @@ +2000-07-21 Alexandre Petit-Bianco + + * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node + or its first operand can be error marks. + +2000-07-20 Alexandre Petit-Bianco + + * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC. + * parse.y (method_header): Likewise. + +2000-07-19 Alexandre Petit-Bianco + + * parse.y (find_as_inner_class): Handle the case where the + enclosing context of an innerclass has been loaded as bytecode. + 2000-07-18 Jeff Sturm * lang-specs.h: Added %(jc1) to java compiler options. diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 687dc951c92..50a9e3e14cd 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -537,7 +537,7 @@ typedef struct _jdeplist { { \ tree returned_type; \ (CHAIN) = 0; \ - if (TREE_TYPE (ctxp->current_parsed_class) == object_type_node \ + if (TREE_TYPE (GET_CPC ()) == object_type_node \ && TREE_CODE (TYPE) == EXPR_WITH_FILE_LOCATION \ && EXPR_WFL_NODE (TYPE) == unqualified_object_id_node) \ (TYPE) = object_type_node; \ diff --git a/gcc/java/parse.y b/gcc/java/parse.y index af7b19b11bd..93eff8684cc 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -3492,7 +3492,18 @@ find_as_inner_class (enclosing, name, cl) else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); - return find_as_inner_class_do (qual, enclosing); + if (!(to_return = find_as_inner_class_do (qual, enclosing))) + { + /* It might be the case that the enclosing class was loaded as + bytecode, in which case it will be missing the + DECL_INNER_CLASS_LIST. We build a fully qualified internal + innerclass name and we try to load it. */ + tree fqin = identifier_subst (name, "", '.', '$', ""); + tree ptr; + BUILD_PTR_FROM_NAME (ptr, fqin); + to_return = resolve_class (NULL_TREE, ptr, NULL_TREE, cl); + } + return to_return; } /* We go inside the list of sub classes and try to find a way @@ -4290,7 +4301,7 @@ method_header (flags, type, mdecl, throws) && !CLASS_INTERFACE (TYPE_NAME (this_class))) parse_error_context (id, "Class `%s' must be declared abstract to define abstract method `%s'", - IDENTIFIER_POINTER (DECL_NAME (ctxp->current_parsed_class)), + IDENTIFIER_POINTER (DECL_NAME (GET_CPC ())), IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); } @@ -10984,7 +10995,7 @@ java_complete_lhs (node) else node = patch_switch_statement (node); - if (TREE_OPERAND (node, 0) == error_mark_node) + if (node == error_mark_node || TREE_OPERAND (node, 0) == error_mark_node) nn = error_mark_node; else { -- 2.11.0