aboutsummaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-10-19 10:44:52 +0000
committerJeff Law <law@gcc.gnu.org>1998-10-19 04:44:52 -0600
commitc3cad2213e4a5153af53760c7e72d28012f6bd9a (patch)
tree19d796ead42a16a0e6601e4e131690933a612a61 /gcc/libgcc2.c
parentb1fc873cc23de79ce54a9070f55cb26189ad6f0d (diff)
downloadgcc-c3cad2213e4a5153af53760c7e72d28012f6bd9a.zip
gcc-c3cad2213e4a5153af53760c7e72d28012f6bd9a.tar.gz
gcc-c3cad2213e4a5153af53760c7e72d28012f6bd9a.tar.bz2
libgcc2.c (eh_context_static): Do not call malloc to allocate the static eh_context structure.
* libgcc2.c (eh_context_static): Do not call malloc to allocate the static eh_context structure. From-SVN: r23175
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 d519f23..21b72af 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