From 723f415edcc9d560beb82983d28ea0607d3c5286 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 23 Jul 2018 12:48:48 +0000 Subject: [PATCH] 2018-07-23 Bernd Edlinger hsa-dump.c (dump_hsa_symbol): Avoid out of scope access to buf. From-SVN: r262931 --- gcc/ChangeLog | 4 ++++ gcc/hsa-dump.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1bf8b46fb18..13cc870ed54 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-07-23 Bernd Edlinger + + hsa-dump.c (dump_hsa_symbol): Avoid out of scope access to buf. + 2018-07-23 Segher Boessenkool * config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Adjust. diff --git a/gcc/hsa-dump.c b/gcc/hsa-dump.c index 4ee53c81277..1407475b0c8 100644 --- a/gcc/hsa-dump.c +++ b/gcc/hsa-dump.c @@ -776,11 +776,11 @@ static void dump_hsa_symbol (FILE *f, hsa_symbol *symbol) { const char *name; + char buf[64]; if (symbol->m_name) name = symbol->m_name; else { - char buf[64]; sprintf (buf, "__%s_%i", hsa_seg_name (symbol->m_segment), symbol->m_name_number); -- 2.30.2