OSDN Git Service

* libgcc2.c (eh_context_static): Do not call malloc to allocate the
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Oct 1998 10:44:52 +0000 (10:44 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Oct 1998 10:44:52 +0000 (10:44 +0000)
        static eh_context structure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23175 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/libgcc2.c

index 0c34c6c..b52a9ad 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 d519f23..21b72af 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