diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2014-09-11 18:20:11 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-09-11 18:20:11 +0000 |
| commit | 5d2c0dfe4cc225a02c7baecf98aeb57923d88327 (patch) | |
| tree | 86c48cbdb8ae54bd16a54910533e09dc3c613732 /compiler-rt/lib/sanitizer_common | |
| parent | 81f36b712fbf1a539ee88dc99be49e6101dcd909 (diff) | |
| download | bcm5719-llvm-5d2c0dfe4cc225a02c7baecf98aeb57923d88327.tar.gz bcm5719-llvm-5d2c0dfe4cc225a02c7baecf98aeb57923d88327.zip | |
[UBSan] Parse common flags from UBSAN_OPTIONS runtime variable even if
UBSan is combined with ASan.
llvm-svn: 217616
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_flags.cc | 6 | ||||
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_flags.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc index 881cc3e7faa..8482751ecae 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc @@ -20,6 +20,7 @@ namespace __sanitizer { CommonFlags common_flags_dont_use; +bool common_flags_defaults_set = false; struct FlagDescription { const char *name; @@ -35,6 +36,11 @@ IntrusiveList<FlagDescription> flag_descriptions; #endif void SetCommonFlagsDefaults(CommonFlags *f) { + CHECK_EQ(common_flags(), f); + if (common_flags_defaults_set) + return; + common_flags_defaults_set = true; + f->symbolize = true; f->external_symbolizer_path = 0; f->allow_addr2line = false; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flags.h b/compiler-rt/lib/sanitizer_common/sanitizer_flags.h index 97641a6c49f..256ca8ce847 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_flags.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_flags.h @@ -67,7 +67,10 @@ inline CommonFlags *common_flags() { return &common_flags_dont_use; } +// Sets default values for common flags. If called multiple times, +// sets default values only once. void SetCommonFlagsDefaults(CommonFlags *f); + void ParseCommonFlagsFromString(CommonFlags *f, const char *str); void PrintFlagDescriptions(); |

