mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
[asan] don't instrument linker-initialized globals even with external linkage in -asan-initialization-order mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168367 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -364,11 +364,9 @@ void AddressSanitizer::instrumentMop(Instruction *I) {
|
||||
if (!ClInitializers)
|
||||
return;
|
||||
// If a global variable does not have dynamic initialization we don't
|
||||
// have to instrument it. However, if a global has external linkage, we
|
||||
// assume it has dynamic initialization, as it may have an initializer
|
||||
// in a different TU.
|
||||
if (G->getLinkage() != GlobalVariable::ExternalLinkage &&
|
||||
!DynamicallyInitializedGlobals.Contains(G))
|
||||
// have to instrument it. However, if a global does not have initailizer
|
||||
// at all, we assume it has dynamic initializer (in other TU).
|
||||
if (G->hasInitializer() && !DynamicallyInitializedGlobals.Contains(G))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user