PR25198, use of out of date pointer

Message ID 20191117225257.GA3312@bubble.grove.modra.org
State New
Headers show
Series
  • PR25198, use of out of date pointer
Related show

Commit Message

Alan Modra Nov. 17, 2019, 10:52 p.m.
Applied.

	PR 25198
	* prdbg.c (tg_start_class_type): Correct scope of idbuf.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index 40cf54b8fe..e582102ab3 100644
--- a/binutils/prdbg.c
+++ b/binutils/prdbg.c
@@ -2117,6 +2117,7 @@  tg_start_class_type (void *p, const char *tag, unsigned int id,
   struct pr_handle *info = (struct pr_handle *) p;
   char *tv = NULL;
   const char *name;
+  char idbuf[20];
 
   info->indent += 2;
 
@@ -2131,8 +2132,6 @@  tg_start_class_type (void *p, const char *tag, unsigned int id,
     name = tag;
   else
     {
-      char idbuf[20];
-
       sprintf (idbuf, "%%anon%u", id);
       name = idbuf;
     }