This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
PR 18091: Valgrind errors building libjava
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Oct 2004 15:35:00 +0100
- Subject: PR 18091: Valgrind errors building libjava
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--)