2009-07-29 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Wed, 29 Jul 2009 23:10:05 +0000 (23:10 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Wed, 29 Jul 2009 23:10:05 +0000 (23:10 +0000)
PR gdb/6817
* dbxread.c (read_dbx_symtab): Reduce stack use.

gdb/ChangeLog
gdb/dbxread.c

index 1fcd4892764de42942d65a83d32376cfe59a9407..b76d68a7d4a22e14218c60a69635d627a1c897f9 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       PR gdb/6817
+       * dbxread.c (read_dbx_symtab): Reduce stack use.
+       
 2009-07-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix gcc-4.5 HEAD warnings.
index 37e9be7ef98f343563a9afc3962d04aed1b91b0d..7cb016ddfed55dc1796cb644cc2b78340921dff1 100644 (file)
@@ -1689,7 +1689,7 @@ pos %d"),
          sym_name = NULL;      /* pacify "gcc -Werror" */
          if (psymtab_language == language_cplus)
            {
-             char *new_name, *name = alloca (p - namestring + 1);
+             char *new_name, *name = xmalloc (p - namestring + 1);
              memcpy (name, namestring, p - namestring);
              name[p - namestring] = '\0';
              new_name = cp_canonicalize_string (name);
@@ -1700,6 +1700,7 @@ pos %d"),
                                           &objfile->objfile_obstack);
                  xfree (new_name);
                }
+              xfree (name);
            }
 
          if (sym_len == 0)