summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_rtl.cc
diff options
context:
space:
mode:
authorSergey Matveev <earthdok@google.com>2013-08-01 14:57:07 +0000
committerSergey Matveev <earthdok@google.com>2013-08-01 14:57:07 +0000
commit6459a370a707f8753cc422ee22bda862e7cb69c9 (patch)
tree0f7c7c07921a8f2e9eca818df94ad376add19ca8 /compiler-rt/lib/asan/asan_rtl.cc
parent9688ff197e99734015c4225de9ffe528c5ffdaec (diff)
downloadbcm5719-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.cc3
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
OpenPOWER on IntegriCloud