OSDN Git Service

PR java/17500:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 25 Sep 2004 19:11:07 +0000 (19:11 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 25 Sep 2004 19:11:07 +0000 (19:11 +0000)
* parse.y (create_artificial_method): Use add_method_1.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88108 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/parse.y

index 60eadf1..4b579bc 100644 (file)
@@ -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
index 8ac79ea..847a532 100644 (file)
@@ -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;