2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 23 Jul 2018 12:48:48 +0000 (12:48 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Mon, 23 Jul 2018 12:48:48 +0000 (12:48 +0000)
        hsa-dump.c (dump_hsa_symbol): Avoid out of scope access to buf.

From-SVN: r262931

gcc/ChangeLog
gcc/hsa-dump.c

index 1bf8b46fb18e1d372873088f97c3757309fabe6e..13cc870ed5466dfc9d540487c440ee42ffe10f75 100644 (file)
@@ -1,3 +1,7 @@
+2018-07-23  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       hsa-dump.c (dump_hsa_symbol): Avoid out of scope access to buf.
+
 2018-07-23  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Adjust.
index 4ee53c81277deea767222ad621f6d79dd2858819..1407475b0c86ead8326ff2a850c688a5dfb5818b 100644 (file)
@@ -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);