forked from OSchip/llvm-project
Update DynInit generation for ASan globals.
Address a follow-up TODO for Sanitizer Metadata. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D128672
This commit is contained in:
parent
dda208c51e
commit
f18de7619e
|
@ -64,13 +64,11 @@ void SanitizerMetadata::reportGlobal(llvm::GlobalVariable *GV,
|
|||
Meta.NoMemtag |= CGM.isInNoSanitizeList(
|
||||
FsanitizeArgument.Mask & SanitizerKind::MemTag, GV, Loc, Ty);
|
||||
|
||||
if (FsanitizeArgument.has(SanitizerKind::Address)) {
|
||||
// TODO(hctim): Make this conditional when we migrate off llvm.asan.globals.
|
||||
IsDynInit &= !CGM.isInNoSanitizeList(SanitizerKind::Address |
|
||||
SanitizerKind::KernelAddress,
|
||||
GV, Loc, Ty, "init");
|
||||
Meta.IsDynInit = IsDynInit;
|
||||
}
|
||||
Meta.IsDynInit = IsDynInit && !Meta.NoAddress &&
|
||||
FsanitizeArgument.has(SanitizerKind::Address) &&
|
||||
!CGM.isInNoSanitizeList(SanitizerKind::Address |
|
||||
SanitizerKind::KernelAddress,
|
||||
GV, Loc, Ty, "init");
|
||||
|
||||
GV->setSanitizerMetadata(Meta);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue