re PR java/18091 (Valgrind errors building libjava)
authorAndrew Haley <aph@redhat.com>
Thu, 21 Oct 2004 14:38:13 +0000 (14:38 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Thu, 21 Oct 2004 14:38:13 +0000 (14:38 +0000)
2004-10-21  Andrew Haley  <aph@redhat.com>

PR java/18091:
* jcf-parse.c (set_source_filename): Add code to build new sfname.

From-SVN: r89376

gcc/java/ChangeLog
gcc/java/jcf-parse.c

index aeae423..5863fec 100644 (file)
@@ -1,3 +1,13 @@
+2004-10-21  Andrew Haley  <aph@redhat.com>
+
+       PR java/18091:
+       * jcf-parse.c (set_source_filename): Add code to build new sfname.
+
+2004-10-20  Andrew Haley  <aph@redhat.com>
+
+       * decl.c (end_java_method): Don't expand if flag_syntax_only.
+       Remove duplicated code block.
+
 2004-10-18  Steven Bosscher  <stevenb@suse.de>
 
        * Make-lang.in (java/parse.o-warn, java/parse-scan.o-warn):
index 46e096d..f04b9f9 100644 (file)
@@ -151,9 +151,11 @@ set_source_filename (JCF *jcf, int index)
       char *dot = strrchr (class_name, '.');
       if (dot != NULL)
        {
-         int i = dot - class_name;
+         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--)
            {