]> granicus.if.org Git - clang/commitdiff
[MSan] Disable sanitization for __sanitizer_dtor_callback.
authorMatt Morehouse <mascasa@google.com>
Wed, 20 Sep 2017 22:53:08 +0000 (22:53 +0000)
committerMatt Morehouse <mascasa@google.com>
Wed, 20 Sep 2017 22:53:08 +0000 (22:53 +0000)
Summary:
Eliminate unnecessary instrumentation at __sanitizer_dtor_callback
call sites.  Fixes https://github.com/google/sanitizers/issues/861.

Reviewers: eugenis, kcc

Reviewed By: eugenis

Subscribers: vitalybuka, llvm-commits, cfe-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D38063

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313831 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-callback.cpp

index 6a41110982ff700229f3c06fc7a02ed40c455dd8..1ebe5219cd19d207c9189e1c76352f5a776f6235 100644 (file)
@@ -1577,6 +1577,7 @@ namespace {
 
  static void EmitSanitizerDtorCallback(CodeGenFunction &CGF, llvm::Value *Ptr,
              CharUnits::QuantityType PoisonSize) {
+   CodeGenFunction::SanitizerScope SanScope(&CGF);
    // Pass in void pointer and size of region as arguments to runtime
    // function
    llvm::Value *Args[] = {CGF.Builder.CreateBitCast(Ptr, CGF.VoidPtrTy),
index e208a6f7e5a551e4059ff68c2d2a68399a4136c4..ecb0f2b2d13b42f78830722cb13e94bb8b51985e 100644 (file)
@@ -55,16 +55,19 @@ Defaulted_Non_Trivial def_non_trivial;
 // to confirm that all invoked dtors have member poisoning
 // instrumentation inserted.
 // CHECK-LABEL: define {{.*}}SimpleD2Ev
+// CHECK-NOT: store i{{[0-9]+}} 0, {{.*}}@__msan_param_tls
 // CHECK: call void @__sanitizer_dtor_callback
 // CHECK-NOT: call void @__sanitizer_dtor_callback
 // CHECK: ret void
 
 // CHECK-LABEL: define {{.*}}InlinedD2Ev
+// CHECK-NOT: store i{{[0-9]+}} 0, {{.*}}@__msan_param_tls
 // CHECK: call void @__sanitizer_dtor_callback
 // CHECK-NOT: call void @__sanitizer_dtor_callback
 // CHECK: ret void
 
 // CHECK-LABEL: define {{.*}}Defaulted_Non_TrivialD2Ev
+// CHECK-NOT: store i{{[0-9]+}} 0, {{.*}}@__msan_param_tls
 // CHECK: call void @__sanitizer_dtor_callback
 // CHECK-NOT: call void @__sanitizer_dtor_callback
 // CHECK: ret void