[PATCH] D128672: Update DynInit generation for ASan globals.

Mitch Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 11 11:44:27 PDT 2022


hctim updated this revision to Diff 443702.
hctim marked an inline comment as done.
hctim added a comment.

Integrate Vitaly's suggestion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128672/new/

https://reviews.llvm.org/D128672

Files:
  clang/lib/CodeGen/SanitizerMetadata.cpp


Index: clang/lib/CodeGen/SanitizerMetadata.cpp
===================================================================
--- clang/lib/CodeGen/SanitizerMetadata.cpp
+++ clang/lib/CodeGen/SanitizerMetadata.cpp
@@ -64,13 +64,11 @@
   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);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128672.443702.patch
Type: text/x-patch
Size: 1095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220711/608a0a73/attachment.bin>


More information about the cfe-commits mailing list