From: Tom Tromey Date: Sat, 25 Sep 2004 19:11:07 +0000 (+0000) Subject: re PR java/17500 (Anonymous inner class compile freakout) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1f042f8b2eb63fedf2045bab0a449071993fdbd;p=gcc.git re PR java/17500 (Anonymous inner class compile freakout) PR java/17500: * parse.y (create_artificial_method): Use add_method_1. From-SVN: r88108 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 60eadf16810..4b579bcfcaf 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2004-09-25 Tom Tromey + + PR java/17500: + * parse.y (create_artificial_method): Use add_method_1. + 2004-09-25 Kazu Hirata * expr.c, jcf-dump.c, parse-scan.y, parse.y: Fix diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 8ac79eaf9ea..847a5325a01 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -7468,7 +7468,11 @@ create_artificial_method (tree class, int flags, tree type, mdecl = make_node (FUNCTION_TYPE); TREE_TYPE (mdecl) = type; TYPE_ARG_TYPES (mdecl) = args; - mdecl = add_method (class, flags, name, build_java_signature (mdecl)); + /* We used to compute the signature of MDECL here and then use + add_method(), but that failed because our caller might modify + the type of the returned method, which trashes the cache in + get_type_from_signature(). */ + mdecl = add_method_1 (class, flags, name, mdecl); java_parser_context_restore_global (); DECL_ARTIFICIAL (mdecl) = 1; return mdecl;