aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 6127d9d..82583e0 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -465,6 +465,8 @@ handle_innerclass_attribute (count, jcf)
/* Read inner_name_index. If the class we're dealing with is
an annonymous class, it must be 0. */
int ini = JCF_readu2 (jcf);
+ /* Read the access flag. */
+ int acc = JCF_readu2 (jcf);
/* If icii is 0, don't try to read the class. */
if (icii >= 0)
{
@@ -475,13 +477,13 @@ handle_innerclass_attribute (count, jcf)
{
tree outer = TYPE_NAME (get_class_constant (jcf, ocii));
tree alias = (ini ? get_name_constant (jcf, ini) : NULL_TREE);
+ set_class_decl_access_flags (acc, decl);
DECL_CONTEXT (decl) = outer;
DECL_INNER_CLASS_LIST (outer) =
tree_cons (decl, alias, DECL_INNER_CLASS_LIST (outer));
CLASS_COMPLETE_P (decl) = 1;
}
}
- JCF_SKIP (jcf, 2);
}
}
@@ -788,10 +790,21 @@ parse_class_file ()
if (METHOD_NATIVE (method))
{
+ tree arg;
+ int decl_max_locals;
+
if (! flag_jni)
continue;
- DECL_MAX_LOCALS (method)
- = list_length (TYPE_ARG_TYPES (TREE_TYPE (method)));
+ /* We need to compute the DECL_MAX_LOCALS. We need to take
+ the wide types into account too. */
+ for (arg = TYPE_ARG_TYPES (TREE_TYPE (method)), decl_max_locals = 0;
+ arg != end_params_node;
+ arg = TREE_CHAIN (arg), decl_max_locals += 1)
+ {
+ if (TREE_VALUE (arg) && TYPE_IS_WIDE (TREE_VALUE (arg)))
+ decl_max_locals += 1;
+ }
+ DECL_MAX_LOCALS (method) = decl_max_locals;
start_java_method (method);
give_name_to_locals (jcf);
expand_expr_stmt (build_jni_stub (method));