mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 03:48:42 +03:00
use EFAULT for buffer overflow and call abort in debug mode (as well as secure mode)
This commit is contained in:
parent
5d212d688f
commit
7ff3ec2bf7
2 changed files with 9 additions and 1 deletions
|
@ -319,6 +319,14 @@ static volatile _Atomic(void*) mi_error_arg; // = NULL
|
|||
|
||||
static void mi_error_default(int err) {
|
||||
UNUSED(err);
|
||||
#if (MI_DEBUG>0)
|
||||
if (err==EFAULT) {
|
||||
#ifdef _MSC_VER
|
||||
__debugbreak();
|
||||
#endif
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
#if (MI_SECURE>0)
|
||||
if (err==EFAULT) { // abort on serious errors in secure mode (corrupted meta-data)
|
||||
abort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue