diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2012-10-23 11:03:29 -0700 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-10-23 11:03:29 -0700 |
commit | 7486fd3bda93a4e5c4c19584982d3da57c6b1044 (patch) | |
tree | 65fc0d54238a7c4686dca359ce073073ab1da904 | |
parent | 1dfda5810c52c30aa6197e7dc3fd44885af380e4 (diff) | |
parent | c3e4e5654d02106a19f315b736d56acb581246f9 (diff) | |
download | toolchain_gcc-7486fd3bda93a4e5c4c19584982d3da57c6b1044.tar.gz toolchain_gcc-7486fd3bda93a4e5c4c19584982d3da57c6b1044.tar.bz2 toolchain_gcc-7486fd3bda93a4e5c4c19584982d3da57c6b1044.zip |
Merge "Workaround for Android __cxa_finalize bug"
-rw-r--r-- | gcc-4.4.3/libstdc++-v3/libsupc++/eh_globals.cc | 8 | ||||
-rw-r--r-- | gcc-4.6/libstdc++-v3/libsupc++/eh_globals.cc | 8 | ||||
-rw-r--r-- | gcc-4.7/libstdc++-v3/libsupc++/eh_globals.cc | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.4.3/libstdc++-v3/libsupc++/eh_globals.cc b/gcc-4.4.3/libstdc++-v3/libsupc++/eh_globals.cc index 63f46a99e..845b6d1ae 100644 --- a/gcc-4.4.3/libstdc++-v3/libsupc++/eh_globals.cc +++ b/gcc-4.4.3/libstdc++-v3/libsupc++/eh_globals.cc @@ -101,6 +101,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; diff --git a/gcc-4.6/libstdc++-v3/libsupc++/eh_globals.cc b/gcc-4.6/libstdc++-v3/libsupc++/eh_globals.cc index 63f46a99e..845b6d1ae 100644 --- a/gcc-4.6/libstdc++-v3/libsupc++/eh_globals.cc +++ b/gcc-4.6/libstdc++-v3/libsupc++/eh_globals.cc @@ -101,6 +101,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; diff --git a/gcc-4.7/libstdc++-v3/libsupc++/eh_globals.cc b/gcc-4.7/libstdc++-v3/libsupc++/eh_globals.cc index 0c7f6b760..fa9b5196b 100644 --- a/gcc-4.7/libstdc++-v3/libsupc++/eh_globals.cc +++ b/gcc-4.7/libstdc++-v3/libsupc++/eh_globals.cc @@ -101,6 +101,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; |