From b18dea91101707b401e5b3ca079facc135ce4201 Mon Sep 17 00:00:00 2001 From: msebor Date: Thu, 1 Sep 2016 22:47:49 +0000 Subject: gcc/c-family/ChangeLog: * c-ada-spec.c (dump_ada_function_declaration): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/cp/ChangeLog: * mangle.c: Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/go/ChangeLog: * gofrontend/expressions.cc: Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/java/ChangeLog: * decl.c (give_name_to_locals): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. * mangle_name.c (append_unicode_mangled_name): Same. gcc/ChangeLog: * genmatch.c (parser::parse_expr): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. * gcc/genmodes.c (parser::parse_expr): Same. * gimplify.c (gimplify_asm_expr): Same. * passes.c (pass_manager::register_one_dump_file): Same. * print-tree.c (print_node): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239949 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/print-tree.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'gcc/print-tree.c') diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 7546f19e33e..e55b6bd6fb6 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -694,8 +694,10 @@ print_node (FILE *file, const char *prefix, tree node, int indent) i = 0; FOR_EACH_CALL_EXPR_ARG (arg, iter, node) { - char temp[10]; - sprintf (temp, "arg %d", i); + /* Buffer big enough to format a 32-bit UINT_MAX into, plus + the text. */ + char temp[15]; + sprintf (temp, "arg %u", i); print_node (file, temp, arg, indent + 4); i++; } @@ -706,7 +708,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent) for (i = 0; i < len; i++) { - char temp[10]; + /* Buffer big enough to format a 32-bit UINT_MAX into, plus + the text. */ + char temp[15]; sprintf (temp, "arg %d", i); print_node (file, temp, TREE_OPERAND (node, i), indent + 4); @@ -824,7 +828,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent) for (i = 0; i < len; i++) if (TREE_VEC_ELT (node, i)) { - char temp[10]; + /* Buffer big enough to format a 32-bit UINT_MAX into, plus + the text. */ + char temp[15]; sprintf (temp, "elt %d", i); print_node (file, temp, TREE_VEC_ELT (node, i), indent + 4); } -- cgit v1.2.1