aboutsummaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorEgor Kochetov <egor.kochetov@intel.com>2015-11-18 16:08:45 +0300
committerEgor Kochetov <egor.kochetov@intel.com>2015-11-18 16:08:45 +0300
commit9d84a30e9bd404df28fdeee7afcc69786fc05c78 (patch)
treee0f8bb21fd6ce98fe5632260467f06770462dd03 /sources
parent18256f885b4f0c1cd5ff6009ed350c745c1b7692 (diff)
downloadndk-9d84a30e9bd404df28fdeee7afcc69786fc05c78.tar.gz
Fixed segfault when throwing exceptions via gabi++
Replaced 'malloc' with 'memalign'. See http://b.android.com/179410 Change-Id: Ib239c80d01a38e7205077febac1a39f3244e2ad7 Signed-off-by: Egor Kochetov <egor.kochetov@intel.com>
Diffstat (limited to 'sources')
-rw-r--r--sources/cxx-stl/gabi++/src/cxxabi.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/cxx-stl/gabi++/src/cxxabi.cc b/sources/cxx-stl/gabi++/src/cxxabi.cc
index 3f428d9d3..7dfc52704 100644
--- a/sources/cxx-stl/gabi++/src/cxxabi.cc
+++ b/sources/cxx-stl/gabi++/src/cxxabi.cc
@@ -296,7 +296,7 @@ namespace __cxxabiv1 {
extern "C" void *__cxa_allocate_exception(size_t thrown_size) _GABIXX_NOEXCEPT {
size_t size = thrown_size + sizeof(__cxa_exception);
- __cxa_exception *buffer = static_cast<__cxa_exception*>(malloc(size));
+ __cxa_exception *buffer = static_cast<__cxa_exception*>(memalign(__alignof__(__cxa_exception), size));
if (!buffer) {
// Since Android uses memory-overcommit, we enter here only when
// the exception object is VERY large. This will propably never happen.