From: Alexandre Petit-Bianco Date: Fri, 31 Dec 1999 03:06:55 +0000 (-0800) Subject: expr.c (expand_invoke): Layout the loaded class before attempting to use it. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6bafd8b6e9fcf4c7a9606af4fc7965717c43a161;p=gcc.git expr.c (expand_invoke): Layout the loaded class before attempting to use it. Thu Dec 16 00:09:45 1999 Alexandre Petit-Bianco * expr.c (expand_invoke): Layout the loaded class before attempting to use it. (expand_java_field_op): Allow final field assignments to take place in $finit$. * typeck.c (convert): Return error_mark_node if expr is null. From-SVN: r31147 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index de49f427036..b90c76bfd28 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -22,6 +22,20 @@ patch_throw_statement, check_thrown_exceptions, patch_conditional_expr): Likewise. +1999-12-17 Tom Tromey + + * gjavah.c (decode_signature_piece): Print "::" in JArray<>. This + fixes PR gcj/119. + (process_file): Use `\n\' at end of each line in string. + +Thu Dec 16 00:09:45 1999 Alexandre Petit-Bianco + + * expr.c (expand_invoke): Layout the loaded class before + attempting to use it. + (expand_java_field_op): Allow final field assignments to take + place in $finit$. + * typeck.c (convert): Return error_mark_node if expr is null. + 1999-12-14 Alexandre Petit-Bianco * class.c (class_depth): Return -1 if the class doesn't load @@ -47,12 +61,6 @@ * typeck.c (lookup_java_method): Take WFLs in method names into account. -1999-12-17 Tom Tromey - - * gjavah.c (decode_signature_piece): Print "::" in JArray<>. This - fixes PR gcj/119. - (process_file): Use `\n\' at end of each line in string. - Tue Dec 14 14:20:16 1999 Per Bothner * class.c (make_class_data): flag_keep_inline_functions to keep diff --git a/gcc/java/expr.c b/gcc/java/expr.c index d789efb6292..1b8d1a104d0 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -1645,6 +1645,7 @@ expand_invoke (opcode, method_ref_index, nargs) if (! CLASS_LOADED_P (self_type)) { load_class (self_type, 1); + safe_layout_class (self_type); if (TREE_CODE (TYPE_SIZE (self_type)) == ERROR_MARK) fatal ("failed to find class '%s'", self_name); } @@ -1816,7 +1817,9 @@ expand_java_field_op (is_static, is_putting, field_ref_index) } else { - if (! DECL_CONSTRUCTOR_P (current_function_decl)) + tree cfndecl_name = DECL_NAME (current_function_decl); + if (! DECL_CONSTRUCTOR_P (current_function_decl) + && (cfndecl_name != finit_identifier_node)) error_with_decl (field_decl, "assignment to final field `%s' " "not in constructor"); } diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c index 213a3899fbc..c536efdf7f3 100644 --- a/gcc/java/typeck.c +++ b/gcc/java/typeck.c @@ -110,6 +110,9 @@ convert (type, expr) { register enum tree_code code = TREE_CODE (type); + if (!expr) + return error_mark_node; + if (do_not_fold) return build1 (NOP_EXPR, type, expr);