This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
~eh_globals to clear _M_init?
- From: Mike Stump <mrs at apple dot com>
- To: libstdc++ at gcc dot gnu dot org, "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 7 Jul 2006 16:29:59 -0700
- Subject: ~eh_globals to clear _M_init?
This is a cleanup that actually fixes the last 2 regressions found by
Geoff's checker for darwin:
libstdc++.sum 27_io/objects/char/6.cc
libstdc++.sum 27_io/objects/wchar_t/6.cc
The code isn't technically wrong, only possibly wrong from the
aesthetic perspective. This is useful on darwin, as it runs the
eh_globals dtor before the cout flushing dtor (which is wrong, fixed
in next OS). By doing this, we reallocate the thread key later and
allow the test to pass as expected instead of delete the thread key
and then trying to use it and then calling terminate because the key
isn't valid.
I hate to even post this, given the details, but, I thought I'd let
others make the decision...
Ok?
* libsupc++/eh_globals.cc (~__eh_globals_init): Unset _M_init.
mrs $ mkdiff libstdc++-v3
Doing diffs in libstdc++-v3:
--- libstdc++-v3/libsupc++/eh_globals.cc.~1~ 2006-01-27
14:56:21.000000000 -0800
+++ libstdc++-v3/libsupc++/eh_globals.cc 2006-07-05
19:27:15.000000000 -0700
@@ -111,6 +111,7 @@ struct __eh_globals_init
{
if (_M_init)
__gthread_key_delete(_M_key);
+ _M_init = false;
}
};
--------------