summaryrefslogtreecommitdiff
path: root/lib/asan/asan_flags.cc
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-01-02 09:59:38 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-01-02 09:59:38 +0000
commitee2d9890ccbda9ef229eeacc8ede3dd365284f4c (patch)
tree61127c2352ab74528d01fcbf2853ece9ada6eec3 /lib/asan/asan_flags.cc
parent45f2ae8d28fc3cfc5d7f1da604fa620c3e09a809 (diff)
Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."
We've got some internal users that either aren't compatible with this or have found a bug with it. Either way, this is an isolated cleanup and so I'm reverting it to un-block folks while we investigate. Alexey and I will be working on fixing everything up so this can be re-committed soon. Sorry for the noise and any inconvenience. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_flags.cc')
-rw-r--r--lib/asan/asan_flags.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/asan/asan_flags.cc b/lib/asan/asan_flags.cc
index 7db1f020c..4099de205 100644
--- a/lib/asan/asan_flags.cc
+++ b/lib/asan/asan_flags.cc
@@ -172,15 +172,13 @@ void ParseFlagsFromString(Flags *f, const char *str) {
}
void InitializeFlags(Flags *f) {
+ CommonFlags *cf = common_flags();
SetCommonFlagsDefaults();
- {
- CommonFlags cf = *common_flags();
- cf.detect_leaks = CAN_SANITIZE_LEAKS;
- cf.external_symbolizer_path = GetEnv("ASAN_SYMBOLIZER_PATH");
- cf.malloc_context_size = kDefaultMallocContextSize;
- cf.intercept_tls_get_addr = true;
- OverrideCommonFlags(cf);
- }
+ cf->detect_leaks = CAN_SANITIZE_LEAKS;
+ cf->external_symbolizer_path = GetEnv("ASAN_SYMBOLIZER_PATH");
+ cf->malloc_context_size = kDefaultMallocContextSize;
+ cf->intercept_tls_get_addr = true;
+ cf->coverage = false;
internal_memset(f, 0, sizeof(*f));
f->quarantine_size = (ASAN_LOW_MEMORY) ? 1UL << 26 : 1UL << 28;
@@ -260,17 +258,17 @@ void InitializeFlags(Flags *f) {
}
// Flag validation:
- if (!CAN_SANITIZE_LEAKS && common_flags()->detect_leaks) {
+ if (!CAN_SANITIZE_LEAKS && cf->detect_leaks) {
Report("%s: detect_leaks is not supported on this platform.\n",
SanitizerToolName);
- Die();
+ cf->detect_leaks = false;
}
// Make "strict_init_order" imply "check_initialization_order".
// TODO(samsonov): Use a single runtime flag for an init-order checker.
if (f->strict_init_order) {
f->check_initialization_order = true;
}
- CHECK_LE((uptr)common_flags()->malloc_context_size, kStackTraceMax);
+ CHECK_LE((uptr)cf->malloc_context_size, kStackTraceMax);
CHECK_LE(f->min_uar_stack_size_log, f->max_uar_stack_size_log);
CHECK_GE(f->redzone, 16);
CHECK_GE(f->max_redzone, f->redzone);