diff options
| -rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/java/parse.y | 6 |
2 files changed, 10 insertions, 1 deletions
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 <tromey@redhat.com> + + PR java/17500: + * parse.y (create_artificial_method): Use add_method_1. + 2004-09-25 Kazu Hirata <kazu@cs.umass.edu> * 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; |

