aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@gcc.gnu.org>1999-12-30 19:06:55 -0800
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>1999-12-30 19:06:55 -0800
commit6bafd8b6e9fcf4c7a9606af4fc7965717c43a161 (patch)
tree52faca7919eba5ef248d7f7847d7d29304793ca8 /gcc/java/expr.c
parent781b0558cfe05d047a2cc0688d94169355818726 (diff)
downloadgcc-6bafd8b6e9fcf4c7a9606af4fc7965717c43a161.zip
gcc-6bafd8b6e9fcf4c7a9606af4fc7965717c43a161.tar.gz
gcc-6bafd8b6e9fcf4c7a9606af4fc7965717c43a161.tar.bz2
expr.c (expand_invoke): Layout the loaded class before attempting to use it.
Thu Dec 16 00:09:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> * 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
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index d789efb..1b8d1a1 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");
}