Skip to content

Commit ccbc8ae

Browse files
committed
add huge allocation test (see #544 by @tiran)
1 parent f2bfaa7 commit ccbc8ae

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ if(MI_DEBUG_UBSAN)
158158
if(CMAKE_BUILD_TYPE MATCHES "Debug")
159159
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
160160
message(STATUS "Build with undefined-behavior sanitizer (MI_DEBUG_UBSAN=ON)")
161-
list(APPEND mi_cflags -fsanitize=undefined -g)
161+
list(APPEND mi_cflags -fsanitize=undefined -g -fno-sanitize-recover=undefined)
162162
list(APPEND CMAKE_EXE_LINKER_FLAGS -fsanitize=undefined)
163163
if (NOT MI_USE_CXX)
164164
message(STATUS "(switch to use C++ due to MI_DEBUG_UBSAN)")

test/test-api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ int main(void) {
7272
CHECK_BODY("calloc0",{
7373
result = (mi_usable_size(mi_calloc(0,1000)) <= 16);
7474
});
75+
CHECK_BODY("malloc-large",{ // see PR #544.
76+
void* p = mi_malloc(67108872);
77+
mi_free(p);
78+
});
7579

7680
// ---------------------------------------------------
7781
// Extended

0 commit comments

Comments
 (0)