[PATCH] [UBSAN] Suppress an error report with given type information

Alexey Samsonov vonosmas at gmail.com
Wed Jul 30 14:08:50 PDT 2014


================
Comment at: lib/ubsan/ubsan_diag.cc:314
@@ +313,3 @@
+
+  ALIGNED(64) static char placeholder[sizeof(SuppressionContext)];
+  suppression_ctx = new(placeholder) SuppressionContext;
----------------
No, I believe we must first move the code for initializing suppression context into sanitizer_common and make "suppressions" a common runtime flag. I will work on it soon. I've submitted the first patch for that in r214334.

================
Comment at: lib/ubsan/ubsan_handlers_cxx.cc:38
@@ +37,3 @@
+
+  // Suppress an error report if it is specified.
+  if (MatchSuppressions(DTI.getMostDerivedTypeName(), SuppressionVptrCheck))
----------------
// Check if error report is suppressed.

================
Comment at: test/ubsan/TestCases/TypeCheck/vptr.cpp:15
@@ +14,3 @@
+// RUN: (echo "vptr_check:S"; echo "vptr_check:T"; echo "vptr_check:U") > %t.supp
+// RUN: (echo " " ; UBSAN_OPTIONS=suppressions=%t.supp %run %t mS 2>&1) | FileCheck %s --check-prefix=CHECK-SUPPRESS
+// RUN: (echo " " ; UBSAN_OPTIONS=suppressions=%t.supp %run %t fS 2>&1) | FileCheck %s --check-prefix=CHECK-SUPPRESS
----------------
Remove stray echo " "

================
Comment at: test/ubsan/TestCases/TypeCheck/vptr.cpp:152
@@ +151,3 @@
+      p->g();
+      p_tmp = p; // Keep leak sanitizer silent.
+      // CHECK-LOC-SUPPRESS-NOT: [[PTR]]: note: object is of type 'S'
----------------
LSan shouldn't be a problem after r214149 I've submitted recently.

http://reviews.llvm.org/D4702






More information about the llvm-commits mailing list