diff options
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index 403318a..44f435c 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -62,7 +62,7 @@ static int supers_all_compiled (tree type); static tree maybe_layout_super_class (tree, tree); static void add_miranda_methods (tree, tree); static int assume_compiled (const char *); -static tree build_symbol_entry (tree); +static tree build_symbol_entry (tree, tree); static tree emit_assertion_table (tree); static void register_class (void); @@ -2651,7 +2651,7 @@ emit_register_classes (tree *list_p) /* Make a symbol_type (_Jv_MethodSymbol) node for DECL. */ static tree -build_symbol_entry (tree decl) +build_symbol_entry (tree decl, tree special) { tree clname, name, signature, sym; clname = build_utf8_ref (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl)))); @@ -2667,6 +2667,12 @@ build_symbol_entry (tree decl) signature = build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (signature), IDENTIFIER_LENGTH (signature))); + /* SPECIAL is either NULL_TREE or integer_one_node. We emit + signature addr+1 if SPECIAL, and this indicates to the runtime + system that this is a "special" symbol, i.e. one that should + bypass access controls. */ + if (special != NULL_TREE) + signature = build2 (PLUS_EXPR, TREE_TYPE (signature), signature, special); START_RECORD_CONSTRUCTOR (sym, symbol_type); PUSH_FIELD_VALUE (sym, "clname", clname); @@ -2701,8 +2707,9 @@ emit_symbol_table (tree name, tree the_table, tree decl_list, list = NULL_TREE; while (method_list != NULL_TREE) { + tree special = TREE_PURPOSE (method_list); method = TREE_VALUE (method_list); - list = tree_cons (NULL_TREE, build_symbol_entry (method), list); + list = tree_cons (NULL_TREE, build_symbol_entry (method, special), list); method_list = TREE_CHAIN (method_list); index++; } |