Author: Mitch Phillips Date: 2022-07-11T12:23:37-07:00 New Revision: f18de7619e5d5dde301d8d4f6f3ec0f8260be710
URL: https://github.com/llvm/llvm-project/commit/f18de7619e5d5dde301d8d4f6f3ec0f8260be710 DIFF: https://github.com/llvm/llvm-project/commit/f18de7619e5d5dde301d8d4f6f3ec0f8260be710.diff LOG: Update DynInit generation for ASan globals. Address a follow-up TODO for Sanitizer Metadata. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D128672 Added: Modified: clang/lib/CodeGen/SanitizerMetadata.cpp Removed: ################################################################################ diff --git a/clang/lib/CodeGen/SanitizerMetadata.cpp b/clang/lib/CodeGen/SanitizerMetadata.cpp index 5f4eb9be981f..0c752304b13d 100644 --- a/clang/lib/CodeGen/SanitizerMetadata.cpp +++ b/clang/lib/CodeGen/SanitizerMetadata.cpp @@ -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); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits