Eliminate fixed size buffer 'the_CIEs' and allocate it dynamically.
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14800 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c
index 14096d4..ec6fd49 100644
--- a/coregrind/m_debuginfo/readdwarf.c
+++ b/coregrind/m_debuginfo/readdwarf.c
@@ -3635,9 +3635,8 @@
    cie->saw_z_augmentation = False;
 }
 
-#define N_CIEs 8000
-static CIE the_CIEs[N_CIEs];
-
+static CIE *the_CIEs = NULL;
+static SizeT N_CIEs = 0;
 
 /* Read, summarise and store CFA unwind info from .eh_frame and
    .debug_frame sections.  is_ehframe tells us which kind we are
@@ -3776,14 +3775,14 @@
 
          /* --------- CIE --------- */
 	 if (di->trace_cfi) 
-            VG_(printf)("------ new CIE (#%d of 0 .. %d) ------\n", 
-                        n_CIEs, N_CIEs - 1);
+            VG_(printf)("------ new CIE #%d ------\n", n_CIEs);
 
 	 /* Allocate a new CIE record. */
-         vg_assert(n_CIEs >= 0 && n_CIEs <= N_CIEs);
+         vg_assert(n_CIEs >= 0);
          if (n_CIEs == N_CIEs) {
-            how = "N_CIEs is too low.  Increase and recompile.";
-            goto bad;
+            N_CIEs += 1000;
+            the_CIEs = ML_(dinfo_realloc)("di.rcid3.2", the_CIEs,
+                                          N_CIEs * sizeof the_CIEs[0]);
          }
 
          this_CIE = n_CIEs;