This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Bug in egcs/gcc/java/mangle.c ?
- To: java-discuss@sourceware.cygnus.com
- Subject: Bug in egcs/gcc/java/mangle.c ?
- From: "Charles Gauthier" <Charles.Gauthier@iit.nrc.ca>
- Date: Wed, 28 Apr 1999 11:14:09 -0400
I am trying to build libgcj on an IBM RS/6000 running AIX 4.2.0. My jvgenmain
generated extra characters at the end of mangled class names (the build failed
trying to generate jv-convert, because jvgenmain "put" extra characters at the
end of the mangled name for gnu.gcj.convert.Convert). I traced the bug to
egcs/gcc/java/mangle.c (append_gpp_mangled_classtype). The mangled string is not
explicitly null terminated after the last call to append_gpp_mangled_name.
My quick fix was
Index: mangle.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/mangle.c,v
retrieving revision 1.8
diff -u -r1.8 mangle.c
--- mangle.c 1999/03/21 06:09:21 1.8
+++ mangle.c 1999/04/28 13:51:09
@@ -158,8 +158,11 @@
if (ptr[0] == '.' || ptr[0] == '\0')
{
append_gpp_mangled_name (obstack, class_name, ptr - class_name);
- if (ptr[0] == '\0')
+ if (ptr[0] == '\0') {
+ /* terminate the string with null */
+ obstack_grow (obstack, "", 1 );
break;
+ }
class_name = ptr + 1;
}
}
--
Charles-Antoine Gauthier
Research Officer
Software Engineering Group
Institute for Information Technology
National Research Council of Canada
Ottawa, ON, Canada
K1A 0R6