diff options
author | Digit' Turner <digit@android.com> | 2014-04-15 13:04:52 -0700 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2014-04-22 15:24:38 -0700 |
commit | 856eafd6efe251c00d0fcc9e60d37ad83032060c (patch) | |
tree | 859bf5dd84f2bd852ad780e50b8ebfec71716e7a | |
parent | e3cc64dec20832769406aa38cde83c7dd4194bf4 (diff) | |
download | toolchain_gcc-856eafd6efe251c00d0fcc9e60d37ad83032060c.tar.gz toolchain_gcc-856eafd6efe251c00d0fcc9e60d37ad83032060c.tar.bz2 toolchain_gcc-856eafd6efe251c00d0fcc9e60d37ad83032060c.zip |
[4.9] Work-around for Android __cxa_finalize bug
Change-Id: Ib479124867ee2c81a761fdb01a80d9cfc681213b
-rw-r--r-- | gcc-4.9/libstdc++-v3/libsupc++/eh_globals.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc-4.9/libstdc++-v3/libsupc++/eh_globals.cc b/gcc-4.9/libstdc++-v3/libsupc++/eh_globals.cc index a0f3dffcd..12e48db6a 100644 --- a/gcc-4.9/libstdc++-v3/libsupc++/eh_globals.cc +++ b/gcc-4.9/libstdc++-v3/libsupc++/eh_globals.cc @@ -100,6 +100,14 @@ struct __eh_globals_init ~__eh_globals_init() { + /* Work-around for an Android-specific bug, where this destructor + * is called with a NULL object pointer. This is due to a bug in the + * __cxa_finalize() implementation that was only fixed in 2.2. + */ +#ifdef __ANDROID__ + if (this == NULL) + return; +#endif if (_M_init) __gthread_key_delete(_M_key); _M_init = false; |