diff options
author | Sergey Matveev <earthdok@google.com> | 2013-08-01 14:57:07 +0000 |
---|---|---|
committer | Sergey Matveev <earthdok@google.com> | 2013-08-01 14:57:07 +0000 |
commit | 6459a370a707f8753cc422ee22bda862e7cb69c9 (patch) | |
tree | 0f7c7c07921a8f2e9eca818df94ad376add19ca8 /compiler-rt/lib/asan/asan_rtl.cc | |
parent | 9688ff197e99734015c4225de9ffe528c5ffdaec (diff) | |
download | bcm5719-llvm-6459a370a707f8753cc422ee22bda862e7cb69c9.tar.gz bcm5719-llvm-6459a370a707f8753cc422ee22bda862e7cb69c9.zip |
[lsan] Add leak_check_at_exit flag.
We needed a way to tell LSan to invoke leak checking only if __do_leak_check()
is called explicitly. This can now be achieved by setting
leak_check_at_exit=false.
llvm-svn: 187578
Diffstat (limited to 'compiler-rt/lib/asan/asan_rtl.cc')
-rw-r--r-- | compiler-rt/lib/asan/asan_rtl.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 1315c2f6f6e..1459374ff03 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -137,6 +137,7 @@ void InitializeFlags(Flags *f, const char *env) { cf->handle_ioctl = false; cf->log_path = 0; cf->detect_leaks = false; + cf->leak_check_at_exit = true; internal_memset(f, 0, sizeof(*f)); f->quarantine_size = (ASAN_LOW_MEMORY) ? 1UL << 26 : 1UL << 28; @@ -556,7 +557,7 @@ void __asan_init() { #if CAN_SANITIZE_LEAKS __lsan::InitCommonLsan(); - if (common_flags()->detect_leaks) { + if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) { Atexit(__lsan::DoLeakCheck); } #endif // CAN_SANITIZE_LEAKS |