libgcc2.c (eh_context_static): Do not call malloc to allocate the static eh_context...
authorJeffrey A Law <law@cygnus.com>
Mon, 19 Oct 1998 10:44:52 +0000 (10:44 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 19 Oct 1998 10:44:52 +0000 (04:44 -0600)
        * libgcc2.c (eh_context_static): Do not call malloc to allocate the
        static eh_context structure.

From-SVN: r23175

gcc/ChangeLog
gcc/libgcc2.c

index 0c34c6c7cb7468c23ee0a272e680ad328d30b54c..b52a9adcedac5054fdc9c7120fbc1caa9b3e5d46 100644 (file)
@@ -1,3 +1,8 @@
+Mon Oct 19 11:40:56 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * libgcc2.c (eh_context_static): Do not call malloc to allocate the
+       static eh_context structure.
+
 Mon Oct 19 10:45:40 1998  Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> 
 
        * combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg.  All
index d519f238ddaa002e6129becdefd56955a1185445..21b72af0db642588129bb18b5b8d4a84a33e19a2 100644 (file)
@@ -3178,10 +3178,15 @@ eh_context_initialize ()
 static struct eh_context *
 eh_context_static ()
 {
-  static struct eh_context *eh;
-  if (! eh)
-    eh = new_eh_context ();
-  return eh;
+  static struct eh_context eh;
+  static int initialized;
+  if (! initialized)
+    {
+      initialized = 1;
+      memset (&eh, 0, sizeof eh);
+      eh.dynamic_handler_chain = top_elt;
+    }
+  return &eh;
 }
 
 #if __GTHREADS