summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_rtl.cc
diff options
context:
space:
mode:
authorSergey Matveev <earthdok@google.com>2013-07-22 12:38:17 +0000
committerSergey Matveev <earthdok@google.com>2013-07-22 12:38:17 +0000
commit9c012165ad184c472692074a3ade2c8515ea7e08 (patch)
treec1dd1831ebb05431f8a0437a4eb3d1b3645f2243 /compiler-rt/lib/asan/asan_rtl.cc
parentcd069e6dec8ed0161e1b48c06739cd5b5352c7cb (diff)
downloadbcm5719-llvm-9c012165ad184c472692074a3ade2c8515ea7e08.tar.gz
bcm5719-llvm-9c012165ad184c472692074a3ade2c8515ea7e08.zip
[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
Also move detect_leaks to common flags. llvm-svn: 186821
Diffstat (limited to 'compiler-rt/lib/asan/asan_rtl.cc')
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc
index 19ed2b795dd..1315c2f6f6e 100644
--- a/compiler-rt/lib/asan/asan_rtl.cc
+++ b/compiler-rt/lib/asan/asan_rtl.cc
@@ -124,7 +124,6 @@ static void ParseFlagsFromString(Flags *f, const char *str) {
ParseFlag(str, &f->use_stack_depot, "use_stack_depot");
ParseFlag(str, &f->strict_memcmp, "strict_memcmp");
ParseFlag(str, &f->strict_init_order, "strict_init_order");
- ParseFlag(str, &f->detect_leaks, "detect_leaks");
}
void InitializeFlags(Flags *f, const char *env) {
@@ -137,6 +136,7 @@ void InitializeFlags(Flags *f, const char *env) {
cf->strip_path_prefix = "";
cf->handle_ioctl = false;
cf->log_path = 0;
+ cf->detect_leaks = false;
internal_memset(f, 0, sizeof(*f));
f->quarantine_size = (ASAN_LOW_MEMORY) ? 1UL << 26 : 1UL << 28;
@@ -173,7 +173,6 @@ void InitializeFlags(Flags *f, const char *env) {
f->use_stack_depot = true;
f->strict_memcmp = true;
f->strict_init_order = false;
- f->detect_leaks = false;
// Override from compile definition.
ParseFlagsFromString(f, MaybeUseAsanDefaultOptionsCompileDefiniton());
@@ -189,17 +188,17 @@ void InitializeFlags(Flags *f, const char *env) {
ParseFlagsFromString(f, env);
#if !CAN_SANITIZE_LEAKS
- if (f->detect_leaks) {
+ if (cf->detect_leaks) {
Report("%s: detect_leaks is not supported on this platform.\n",
SanitizerToolName);
- f->detect_leaks = false;
+ cf->detect_leaks = false;
}
#endif
- if (f->detect_leaks && !f->use_stack_depot) {
+ if (cf->detect_leaks && !f->use_stack_depot) {
Report("%s: detect_leaks is ignored (requires use_stack_depot).\n",
SanitizerToolName);
- f->detect_leaks = false;
+ cf->detect_leaks = false;
}
}
@@ -557,7 +556,7 @@ void __asan_init() {
#if CAN_SANITIZE_LEAKS
__lsan::InitCommonLsan();
- if (flags()->detect_leaks) {
+ if (common_flags()->detect_leaks) {
Atexit(__lsan::DoLeakCheck);
}
#endif // CAN_SANITIZE_LEAKS
OpenPOWER on IntegriCloud