Bug in egcs/gcc/java/mangle.c ?
Charles Gauthier
Charles.Gauthier@iit.nrc.ca
Wed Apr 28 08:14:00 GMT 1999
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
More information about the Java
mailing list