diff options
author | Max Moroz <mmoroz@chromium.org> | 2019-09-09 19:30:48 +0000 |
---|---|---|
committer | Max Moroz <mmoroz@chromium.org> | 2019-09-09 19:30:48 +0000 |
commit | e6ebd8de804b785ccb160e5914578b90edf6e455 (patch) | |
tree | 1a3b82d7028a2945aa8a189812c143e96a85c94a | |
parent | a5142c0c415d0c6565a82a7c109d6f9677971bda (diff) | |
download | compiler-rt-e6ebd8de804b785ccb160e5914578b90edf6e455.tar.gz |
[UBSan] Do not overwrite the default print_summary sanitizer option.
Summary:
This option is true by default in sanitizer common. The default
false value was added a while ago without any reasoning in
https://github.com/llvm-mirror/compiler-rt/commit/524e934112a593ac081bf2b05aa0d60a67987f05
so, presumably it's safe to remove for consistency.
Reviewers: hctim, samsonov, morehouse, kcc, vitalybuka
Reviewed By: hctim, samsonov, vitalybuka
Subscribers: delcypher, #sanitizers, llvm-commits, kcc
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D67193
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371442 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/ubsan/ubsan_flags.cpp | 1 | ||||
-rw-r--r-- | test/ubsan/TestCases/Misc/print_summary.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/ubsan/ubsan_flags.cpp b/lib/ubsan/ubsan_flags.cpp index 80de2a6d1..721c2273f 100644 --- a/lib/ubsan/ubsan_flags.cpp +++ b/lib/ubsan/ubsan_flags.cpp @@ -54,7 +54,6 @@ void InitializeFlags() { { CommonFlags cf; cf.CopyFrom(*common_flags()); - cf.print_summary = false; cf.external_symbolizer_path = GetFlag("UBSAN_SYMBOLIZER_PATH"); OverrideCommonFlags(cf); } diff --git a/test/ubsan/TestCases/Misc/print_summary.c b/test/ubsan/TestCases/Misc/print_summary.c new file mode 100644 index 000000000..b67a0614d --- /dev/null +++ b/test/ubsan/TestCases/Misc/print_summary.c @@ -0,0 +1,11 @@ +// RUN: %clang -fsanitize=undefined %s -O3 -o %t +// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT +// RUN: %env_ubsan_opts=print_summary=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NO_SUMMARY + +// CHECK-DEFAULT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}} +// CHECK-NO_SUMMARY-NOT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}} + +int main(int argc, char **argv) { + int arr[argc - 2]; + return 0; +} |