aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9
diff options
context:
space:
mode:
authorDigit' Turner <digit@android.com>2014-04-15 13:04:52 -0700
committerAndrew Hsieh <andrewhsieh@google.com>2014-04-22 15:24:38 -0700
commit856eafd6efe251c00d0fcc9e60d37ad83032060c (patch)
tree859bf5dd84f2bd852ad780e50b8ebfec71716e7a /gcc-4.9
parente3cc64dec20832769406aa38cde83c7dd4194bf4 (diff)
downloadtoolchain_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
Diffstat (limited to 'gcc-4.9')
-rw-r--r--gcc-4.9/libstdc++-v3/libsupc++/eh_globals.cc8
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;