Commit 71e68384 by Michael Chastain Committed by Andrew Haley

class.c (gen_indirect_dispatch_tables): Fix string length calculations.

2004-01-15  Michael Chastain  <mec.gnu@mindspring.com>

        * class.c (gen_indirect_dispatch_tables): Fix string length
        calculations.

From-SVN: r75913
parent ad5d827d
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> 2004-01-15 Kelley Cook <kcook@gcc.gnu.org>
* Make-lang.in (parse.c, parse-scan.c): Always build in doc directory. * Make-lang.in (parse.c, parse-scan.c): Always build in doc directory.
......
...@@ -313,7 +313,7 @@ gen_indirect_dispatch_tables (tree type) ...@@ -313,7 +313,7 @@ gen_indirect_dispatch_tables (tree type)
const char *typename = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); const char *typename = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
{ {
tree field = NULL; 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); tree catch_class_type = make_node (RECORD_TYPE);
sprintf (buf, "_catch_classes_%s", typename); sprintf (buf, "_catch_classes_%s", typename);
...@@ -335,7 +335,7 @@ gen_indirect_dispatch_tables (tree type) ...@@ -335,7 +335,7 @@ gen_indirect_dispatch_tables (tree type)
if (flag_indirect_dispatch) 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); sprintf (buf, "_otable_%s", typename);
TYPE_OTABLE_DECL (type) = TYPE_OTABLE_DECL (type) =
...@@ -356,7 +356,7 @@ gen_indirect_dispatch_tables (tree 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; tree decl;
sprintf (buf, "_atable_%s", typename); sprintf (buf, "_atable_%s", typename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment