From ca4961c0956bb3a6ed4fee5181717afbe4978058 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 5 Dec 2002 22:34:59 +0000 Subject: * stdlib/cxa_finalize.c (__cxa_finalize): When given a null argument, call all functions rather than none. Reported by Mark P. Mitchell . --- stdlib/cxa_finalize.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'stdlib') diff --git a/stdlib/cxa_finalize.c b/stdlib/cxa_finalize.c index e42f6bd..16f5028 100644 --- a/stdlib/cxa_finalize.c +++ b/stdlib/cxa_finalize.c @@ -29,15 +29,12 @@ __cxa_finalize (void *d) { struct exit_function_list *funcs; - if (!d) - return; - for (funcs = __exit_funcs; funcs; funcs = funcs->next) { struct exit_function *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. */ && compare_and_swap (&f->flavor, ef_cxa, ef_free)) (*f->func.cxa.fn) (f->func.cxa.arg, 0); -- cgit v1.1