This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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--)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]