llvm.org GIT mirror llvm / b01b302
[MSan] Disable sanitization for __sanitizer_dtor_callback. 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/llvm/trunk@313831 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Morehouse 2 years ago
2 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
25872587
25882588 void visitCallSite(CallSite CS) {
25892589 Instruction &I = *CS.getInstruction();
2590 if (I.getMetadata("nosanitize")) return;
25902591 assert((CS.isCall() || CS.isInvoke()) && "Unknown type of CallSite");
25912592 if (CS.isCall()) {
25922593 CallInst *Call = cast(&I);
0 ; Verify that calls with !nosanitize are not instrumented by MSan.
1 ; RUN: opt < %s -msan -S | FileCheck %s
2 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
4
5 declare void @bar(i32 %x)
6
7 define void @foo() {
8 call void @bar(i32 7), !nosanitize !{}
9 ret void
10 }
11
12 ; CHECK-LABEL: define void @foo
13 ; CHECK-NOT: store i{{[0-9]+}} 0, {{.*}} @__msan_param_tls
14 ; CHECK: call void @bar
15 ; CHECK: ret void