summaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-19 10:44:52 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-19 10:44:52 +0000
commitc058cad4db2855848a342bb9ec4fc7e8117d408f (patch)
tree19d796ead42a16a0e6601e4e131690933a612a61 /gcc/libgcc2.c
parent4acfa06d2359e9bd85ae3ce06c77dc45d2890267 (diff)
downloadgcc-c058cad4db2855848a342bb9ec4fc7e8117d408f.tar.gz
* libgcc2.c (eh_context_static): Do not call malloc to allocate the
static eh_context structure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23175 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r--gcc/libgcc2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index d519f238dda..21b72af0db6 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -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