[llvm-branch-commits] [compiler-rt] [ASan][Darwin] Support gapless shadow layout for iOS 27.0 (PR #217530)
Andrew Haberlandt via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Aug 24 23:48:06 PDT 2026
================
@@ -314,6 +314,15 @@ extern uptr kHighMemEnd, kMidMemBeg, kMidMemEnd; // Initialized in __asan_init.
# define kMidShadowBeg MEM_TO_SHADOW(kMidMemBeg)
# define kMidShadowEnd MEM_TO_SHADOW(kMidMemEnd)
+// If the first byte of shadow can be placed after the last byte of app mem,
+// we don't need a gap since the shadow's shadow won't be in the middle
+// of app mem.
+# if SANITIZER_APPLE
+# define kGaplessShadow (kLowShadowBeg > kHighMemEnd)
----------------
ndrewh wrote:
IMO, it's clearer to have this define here in a header (which also contains many other platform-specific defines) rather than having to wrap a big if case with`#if SANITIZER_APPLE` in .asan_shadow_setup.cpp.
https://github.com/llvm/llvm-project/pull/217530
More information about the llvm-branch-commits
mailing list