[PATCH] D67193: [UBSan] Do not overwrite the default print_summary sanitizer option.

Max Moroz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 12:32:28 PDT 2019


Dor1s updated this revision to Diff 219410.
Dor1s added a comment.

Added a test


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67193/new/

https://reviews.llvm.org/D67193

Files:
  lib/ubsan/ubsan_flags.cpp
  test/ubsan/TestCases/Misc/print_summary.c


Index: test/ubsan/TestCases/Misc/print_summary.c
===================================================================
--- /dev/null
+++ 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;
+}
Index: lib/ubsan/ubsan_flags.cpp
===================================================================
--- lib/ubsan/ubsan_flags.cpp
+++ lib/ubsan/ubsan_flags.cpp
@@ -54,7 +54,6 @@
   {
     CommonFlags cf;
     cf.CopyFrom(*common_flags());
-    cf.print_summary = false;
     cf.external_symbolizer_path = GetFlag("UBSAN_SYMBOLIZER_PATH");
     OverrideCommonFlags(cf);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67193.219410.patch
Type: text/x-patch
Size: 996 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190909/d635bea9/attachment.bin>


More information about the llvm-commits mailing list