diff options
author | Kostya Serebryany <kcc@google.com> | 2015-01-07 02:37:52 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-01-07 02:37:52 +0000 |
commit | c26d26c3f3cde1121cb8f081c991fca8973d28bc (patch) | |
tree | 1914ef006a0fa169e07e4d65f94a8853e818f8be /lib/asan/asan_flags.cc | |
parent | b3793db6a5060ab98be7f01a5d9e8247e95f4261 (diff) |
[asan] add flag quarantine_size_mb, deprecate quarantine_size
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_flags.cc')
-rw-r--r-- | lib/asan/asan_flags.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/asan/asan_flags.cc b/lib/asan/asan_flags.cc index d6144a7a6..2c2d5c8f1 100644 --- a/lib/asan/asan_flags.cc +++ b/lib/asan/asan_flags.cc @@ -64,6 +64,7 @@ void InitializeFlags(Flags *f) { OverrideCommonFlags(cf); } + const int kDefaultQuarantineSizeMb = (ASAN_LOW_MEMORY) ? 1UL << 6 : 1UL << 8; f->SetDefaults(); // Override from compile definition. @@ -118,6 +119,18 @@ void InitializeFlags(Flags *f) { CHECK_LE(f->max_redzone, 2048); CHECK(IsPowerOfTwo(f->redzone)); CHECK(IsPowerOfTwo(f->max_redzone)); + + // quarantine_size is deprecated but we still honor it. + // quarantine_size can not be used together with quarantine_size_mb. + if (f->quarantine_size >= 0 && f->quarantine_size_mb >= 0) { + Report("%s: please use either 'quarantine_size' (deprecated) or " + "quarantine_size_mb, but not both\n", SanitizerToolName); + Die(); + } + if (f->quarantine_size >= 0) + f->quarantine_size_mb = f->quarantine_size >> 20; + if (f->quarantine_size_mb < 0) + f->quarantine_size_mb = kDefaultQuarantineSizeMb; } } // namespace __asan |