llvm.org GIT mirror llvm / d2703de
[asan] do not instrument threadlocal globals, this is buggy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145092 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 7 years ago
2 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
454454 G->getLinkage() != GlobalVariable::PrivateLinkage &&
455455 G->getLinkage() != GlobalVariable::InternalLinkage)
456456 continue;
457 // Two problems with thread-locals:
458 // - The address of the main thread's copy can't be computed at link-time.
459 // - Need to poison all copies, not just the main thread's one.
460 if (G->isThreadLocal())
461 continue;
457462 // For now, just ignore this Alloca if the alignment is large.
458463 if (G->getAlignment() > RedzoneSize) continue;
459464
786791
787792 // Workaround for bug 11395: we don't want to instrument stack in functions
788793 // with large assembly blobs (32-bit only), otherwise reg alloc may crash.
794 // FIXME: remove once the bug 11395 is fixed.
789795 bool AddressSanitizer::LooksLikeCodeInBug11395(Instruction *I) {
790796 if (LongSize != 32) return false;
791797 CallInst *CI = dyn_cast(I);
0 ; RUN: opt < %s -asan -S | FileCheck %s
1 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"
2 target triple = "x86_64-unknown-linux-gnu"
3 ; no action should be taken for thread locals
4 @xxx = thread_local global i32 0, align 4
5 ; CHECK-NOT: __asan_register_globals