copy 'detect_leaks=0' from ASAN to LSAN

fix for issue #1733, set "detect_leaks=0" when ASAN_OPTIONS contains it and LSAN_OPTIONS are not set.
This commit is contained in:
hexcoder
2023-11-04 22:01:09 +01:00
committed by GitHub
parent 7e67dc9d69
commit 8338844284

View File

@ -103,7 +103,12 @@ void set_sanitizer_defaults() {
u8 buf[2048] = "";
if (!have_san_options) { strcpy(buf, default_options); }
if (have_san_options && NULL != strstr(have_asan_options, "detect_leaks=0")) {
strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=0:malloc_context_size=30:");
} else {
strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=1:malloc_context_size=30:");
}
setenv("LSAN_OPTIONS", buf, 1);
}