llvm.org GIT mirror llvm / 0307b9a
[asan] enable asan only for the functions that have Attribute::AddressSafety git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148846 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 7 years ago
4 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
607607 bool AddressSanitizer::handleFunction(Module &M, Function &F) {
608608 if (BL->isIn(F)) return false;
609609 if (&F == AsanCtorFunction) return false;
610 if (!F.hasFnAttr(Attribute::AddressSafety)) return false;
610611
611612 if (!ClDebugFunc.empty() && ClDebugFunc != F.getName())
612613 return false;
3535 @ff_mlp_firorder_7 = external global i8
3636 @ff_mlp_firorder_8 = external global i8
3737
38 define void @ff_mlp_init_x86(%struct.DSPContext* nocapture %c, %struct.AVCodecContext* nocapture %avctx) nounwind {
38 define void @ff_mlp_init_x86(%struct.DSPContext* nocapture %c, %struct.AVCodecContext* nocapture %avctx) nounwind address_safety {
3939 entry:
4040 %mlp_filter_channel = getelementptr inbounds %struct.DSPContext* %c, i32 0, i32 131
4141 store void (i32*, i32*, i32, i32, i32, i32, i32, i32*)* @mlp_filter_channel_x86, void (i32*, i32*, i32, i32, i32, i32, i32, i32*)** %mlp_filter_channel, align 4, !tbaa !0
4242 ret void
4343 }
4444
45 define internal void @mlp_filter_channel_x86(i32* %state, i32* %coeff, i32 %firorder, i32 %iirorder, i32 %filter_shift, i32 %mask, i32 %blocksize, i32* %sample_buffer) nounwind {
45 define internal void @mlp_filter_channel_x86(i32* %state, i32* %coeff, i32 %firorder, i32 %iirorder, i32 %filter_shift, i32 %mask, i32 %blocksize, i32* %sample_buffer) nounwind address_safety {
4646 entry:
4747 %filter_shift.addr = alloca i32, align 4
4848 %mask.addr = alloca i32, align 4
33
44 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
55 target triple = "x86_64-unknown-linux-gnu"
6 define void @IncrementMe(i32* %a) {
6 define void @IncrementMe(i32* %a) address_safety {
77 entry:
88 %tmp1 = load i32* %a, align 4
99 %tmp2 = add i32 %tmp1, 1
0 ; RUN: opt < %s -asan -S | FileCheck %s
11 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
22 target triple = "x86_64-unknown-linux-gnu"
3 define i32 @read_4_bytes(i32* %a) {
3 define i32 @read_4_bytes(i32* %a) address_safety {
44 entry:
55 %tmp1 = load i32* %a, align 4
66 ret i32 %tmp1