* stdlib/cxa_finalize.c (__cxa_finalize): When given a null argument,
call all functions rather than none. Reported by Mark P. Mitchell <mark@codesourcery.com>.
This commit is contained in:
parent
11767d4767
commit
ca4961c095
@ -1,3 +1,9 @@
|
|||||||
|
2002-12-05 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* stdlib/cxa_finalize.c (__cxa_finalize): When given a null argument,
|
||||||
|
call all functions rather than none.
|
||||||
|
Reported by Mark P. Mitchell <mark@codesourcery.com>.
|
||||||
|
|
||||||
2002-12-04 Roland McGrath <roland@redhat.com>
|
2002-12-04 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* locale/localeinfo.h [NL_CURRENT_INDIRECT]: Use attribute_tls_model_ie
|
* locale/localeinfo.h [NL_CURRENT_INDIRECT]: Use attribute_tls_model_ie
|
||||||
|
@ -29,15 +29,12 @@ __cxa_finalize (void *d)
|
|||||||
{
|
{
|
||||||
struct exit_function_list *funcs;
|
struct exit_function_list *funcs;
|
||||||
|
|
||||||
if (!d)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (funcs = __exit_funcs; funcs; funcs = funcs->next)
|
for (funcs = __exit_funcs; funcs; funcs = funcs->next)
|
||||||
{
|
{
|
||||||
struct exit_function *f;
|
struct exit_function *f;
|
||||||
|
|
||||||
for (f = &funcs->fns[funcs->idx - 1]; f >= &funcs->fns[0]; --f)
|
for (f = &funcs->fns[funcs->idx - 1]; f >= &funcs->fns[0]; --f)
|
||||||
if (d == f->func.cxa.dso_handle
|
if ((d == NULL || d == f->func.cxa.dso_handle)
|
||||||
/* We don't want to run this cleanup more than once. */
|
/* We don't want to run this cleanup more than once. */
|
||||||
&& compare_and_swap (&f->flavor, ef_cxa, ef_free))
|
&& compare_and_swap (&f->flavor, ef_cxa, ef_free))
|
||||||
(*f->func.cxa.fn) (f->func.cxa.arg, 0);
|
(*f->func.cxa.fn) (f->func.cxa.arg, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user