This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
gcj patch: unwrap method names in constant pool
- To: gcc-patches at gcc dot gnu dot org
- Subject: gcj patch: unwrap method names in constant pool
- From: Anthony Green <green at cygnus dot com>
- Date: Sat, 6 Nov 1999 09:52:58 -0800 (PST)
Gcj puts garbage method names in the constant pool. Occasionally this
would show up as enormous class files that couldn't be read by either
jcf-dump or gcj.
1999-11-07 Anthony Green <green@cygnus.com>
* constants.c (find_methodref_index): Unwrap method names before
inserting them in the constant pool.
Index: gcc/java/constants.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/constants.c,v
retrieving revision 1.8
diff -u -r1.8 constants.c
--- constants.c 1999/03/21 06:09:05 1.8
+++ constants.c 1999/11/06 17:46:33
@@ -200,8 +200,11 @@
int class_index = find_class_constant (cpool, mclass);
tree name = DECL_CONSTRUCTOR_P (decl) ? init_identifier_node
: DECL_NAME (decl);
- int name_type_index
- = find_name_and_type_constant (cpool, name, TREE_TYPE (decl));
+ int name_type_index;
+ if (TREE_CODE (name) == EXPR_WITH_FILE_LOCATION)
+ name = EXPR_WFL_NODE (name);
+ name_type_index =
+ find_name_and_type_constant (cpool, name, TREE_TYPE (decl));
return find_constant1 (cpool,
CLASS_INTERFACE (TYPE_NAME (mclass))
? CONSTANT_InterfaceMethodref
--
Anthony Green Cygnus Solutions
Sunnyvale, California