From: Jeffrey A Law Date: Mon, 19 Oct 1998 10:44:52 +0000 (+0000) Subject: libgcc2.c (eh_context_static): Do not call malloc to allocate the static eh_context... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c3cad2213e4a5153af53760c7e72d28012f6bd9a;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0c34c6c7cb7..b52a9adceda 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg. All 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