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/passes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/passes.c') diff --git a/gcc/passes.c b/gcc/passes.c index c7d7dbe7e91..07ebf8b4a2f 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -771,7 +771,9 @@ pass_manager::register_one_dump_file (opt_pass *pass) { char *dot_name, *flag_name, *glob_name; const char *name, *full_name, *prefix; - char num[10]; + + /* Buffer big enough to format a 32-bit UINT_MAX into. */ + char num[11]; int flags, id; int optgroup_flags = OPTGROUP_NONE; gcc::dump_manager *dumps = m_ctxt->get_dumps (); @@ -779,7 +781,7 @@ pass_manager::register_one_dump_file (opt_pass *pass) /* See below in next_pass_1. */ num[0] = '\0'; if (pass->static_pass_number != -1) - sprintf (num, "%d", ((int) pass->static_pass_number < 0 + sprintf (num, "%u", ((int) pass->static_pass_number < 0 ? 1 : pass->static_pass_number)); /* The name is both used to identify the pass for the purposes of plugins, -- cgit v1.2.1