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

Alexey Samsonov vonosmas at gmail.com
Thu Jul 31 17:39:20 PDT 2014


================
Comment at: lib/ubsan/ubsan_diag.cc:317
@@ +316,3 @@
+
+void __ubsan::InitializeSuppressions() {
+  SuppressionContext::InitIfNecessary();
----------------
You may now get rid of this function and call SuppressionContext::InitIfNecessary() from __ubsan::InitIfNecessary() directly.

================
Comment at: lib/ubsan/ubsan_handlers_cxx.cc:37
@@ +36,3 @@
+  DynamicTypeInfo DTI = getDynamicTypeInfo((void*)Pointer);
+  const char *MostDerivedTypeName = DTI.getMostDerivedTypeName();
+
----------------
why not create and pass MangledName around?

================
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 "" ; ASAN_OPTIONS="$ASAN_OPTIONS suppressions=%t.supp" UBSAN_OPTIONS=suppressions=%t.supp %run %t mS 2>&1) | FileCheck %s --check-prefix=CHECK-SUPPRESS
+// RUN: (echo "" ; ASAN_OPTIONS="$ASAN_OPTIONS suppressions=%t.supp" UBSAN_OPTIONS=suppressions=%t.supp %run %t fS 2>&1) | FileCheck %s --check-prefix=CHECK-SUPPRESS
----------------
echo ""; remains a mystery for me.

http://reviews.llvm.org/D4702






More information about the llvm-commits mailing list