OSDN Git Service

2004-01-15 Michael Chastain <mec.gnu@mindspring.com>
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Jan 2004 10:24:25 +0000 (10:24 +0000)
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Jan 2004 10:24:25 +0000 (10:24 +0000)
        * class.c (gen_indirect_dispatch_tables): Fix string length
        calculations.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75913 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/class.c

index 213f50e..a7c2855 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-15  Michael Chastain  <mec.gnu@mindspring.com>
+
+       * class.c (gen_indirect_dispatch_tables): Fix string length
+       calculations.
+
 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
 
        * Make-lang.in (parse.c, parse-scan.c): Always build in doc directory.
index bf9f79e..58cf778 100644 (file)
@@ -313,7 +313,7 @@ gen_indirect_dispatch_tables (tree type)
   const char *typename = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
   {  
     tree field = NULL;
-    char *buf = alloca (strlen (typename) + strlen ("_catch_classes_"));
+    char *buf = alloca (strlen (typename) + strlen ("_catch_classes_") + 1);
     tree catch_class_type = make_node (RECORD_TYPE);
 
     sprintf (buf, "_catch_classes_%s", typename);
@@ -335,7 +335,7 @@ gen_indirect_dispatch_tables (tree type)
   if (flag_indirect_dispatch)
     {
       {
-       char *buf = alloca (strlen (typename) + strlen ("_otable_syms_"));
+       char *buf = alloca (strlen (typename) + strlen ("_otable_syms_") + 1);
 
        sprintf (buf, "_otable_%s", typename);
        TYPE_OTABLE_DECL (type) = 
@@ -356,7 +356,7 @@ gen_indirect_dispatch_tables (tree type)
       }
 
       {
-       char *buf = alloca (strlen (typename) + strlen ("_atable_syms_"));
+       char *buf = alloca (strlen (typename) + strlen ("_atable_syms_") + 1);
        tree decl;
 
        sprintf (buf, "_atable_%s", typename);