diff options
Diffstat (limited to 'libsanitizer/asan/asan_flags.cc')
-rw-r--r-- | libsanitizer/asan/asan_flags.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libsanitizer/asan/asan_flags.cc b/libsanitizer/asan/asan_flags.cc index 0c83dac6747..522fce30f05 100644 --- a/libsanitizer/asan/asan_flags.cc +++ b/libsanitizer/asan/asan_flags.cc @@ -31,10 +31,7 @@ static const char *MaybeCallAsanDefaultOptions() { static const char *MaybeUseAsanDefaultOptionsCompileDefinition() { #ifdef ASAN_DEFAULT_OPTIONS -// Stringize the macro value. -# define ASAN_STRINGIZE(x) #x -# define ASAN_STRINGIZE_OPTIONS(options) ASAN_STRINGIZE(options) - return ASAN_STRINGIZE_OPTIONS(ASAN_DEFAULT_OPTIONS); + return SANITIZER_STRINGIFY(ASAN_DEFAULT_OPTIONS); #else return ""; #endif @@ -146,6 +143,9 @@ void InitializeFlags() { SanitizerToolName); Die(); } + // Ensure that redzone is at least SHADOW_GRANULARITY. + if (f->redzone < (int)SHADOW_GRANULARITY) + f->redzone = SHADOW_GRANULARITY; // 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) { @@ -158,6 +158,10 @@ void InitializeFlags() { CHECK_LE(f->max_redzone, 2048); CHECK(IsPowerOfTwo(f->redzone)); CHECK(IsPowerOfTwo(f->max_redzone)); + if (SANITIZER_RTEMS) { + CHECK(!f->unmap_shadow_on_exit); + CHECK(!f->protect_shadow_gap); + } // quarantine_size is deprecated but we still honor it. // quarantine_size can not be used together with quarantine_size_mb. |