From 53084cc5c285954d576b2f4a19a230a853014f82 Mon Sep 17 00:00:00 2001 From: David Goldblatt Date: Mon, 3 Aug 2020 18:24:05 -0700 Subject: [PATCH] Safety check: Don't directly abort. The sized dealloc checks called the generic safety_check_fail, and then called abort. This means the failure case isn't mockable, hence not testable. Fix it in anticipation of a coming diff. --- src/safety_check.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/safety_check.c b/src/safety_check.c index a83dca76..c692835a 100644 --- a/src/safety_check.c +++ b/src/safety_check.c @@ -4,7 +4,6 @@ static void (*safety_check_abort)(const char *message); void safety_check_fail_sized_dealloc(bool current_dealloc) { - assert(config_opt_safety_checks); char *src = current_dealloc ? "the current pointer being freed" : "in thread cache, possibly from previous deallocations"; @@ -12,7 +11,6 @@ void safety_check_fail_sized_dealloc(bool current_dealloc) { " application sized deallocation bugs (source: %s). Suggest building" "with --enable-debug or address sanitizer for debugging. Abort.\n", src); - abort(); } void safety_check_set_abort(void (*abort_fn)(const char *)) {