PR 18091: Valgrind errors building libjava
Andrew Haley
aph@redhat.com
Thu Oct 21 14:35:00 GMT 2004
A couple of lines seemed to be missing from Per's checkin.
Andrew.
2004-10-21 Andrew Haley <aph@redhat.com>
* jcf-parse.c (set_source_filename): Add code to build new sfname.
Index: jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.175
diff -p -2 -c -r1.175 jcf-parse.c
*** jcf-parse.c 5 Oct 2004 14:55:39 -0000 1.175
--- jcf-parse.c 21 Oct 2004 14:31:27 -0000
*************** set_source_filename (JCF *jcf, int index
*** 152,158 ****
if (dot != NULL)
{
! int i = dot - class_name;
/* Concatenate current package prefix with new sfname. */
char *buf = xmalloc (i+new_len+3);
/* Replace '.' by DIR_SEPARATOR. */
for (; i >= 0; i--)
--- 152,160 ----
if (dot != NULL)
{
! int i = dot - class_name + 1;
/* Concatenate current package prefix with new sfname. */
char *buf = xmalloc (i+new_len+3);
+ memcpy (buf, class_name, i);
+ strcpy (buf + i, sfname);
/* Replace '.' by DIR_SEPARATOR. */
for (; i >= 0; i--)
More information about the Java-patches
mailing list