summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-01-23 01:43:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-23 01:43:47 +0000
commit0a692a6d8d8c003749f959b6073f32f9c2c07604 (patch)
treed470055e9c71be4cb3b5524050e347d497cc40a3 /libc/malloc_debug/malloc_debug.cpp
parent011523f4dfd65fea3be3e5f2004cb090a557e868 (diff)
parent7f209a979c55a58e91946a2efd5f0b339ffe309c (diff)
Merge "Bionic malloc debug: add a new option "abort_on_error""
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
-rw-r--r--libc/malloc_debug/malloc_debug.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp
index 9075a9caa..2e6afff55 100644
--- a/libc/malloc_debug/malloc_debug.cpp
+++ b/libc/malloc_debug/malloc_debug.cpp
@@ -154,6 +154,9 @@ static void LogError(const void* pointer, const char* error_str) {
error_log("Backtrace at time of failure:");
BacktraceAndLog();
error_log(LOG_DIVIDER);
+ if (g_debug->config().options() & ABORT_ON_ERROR) {
+ abort();
+ }
}
static bool VerifyPointer(const void* pointer, const char* function_name) {