[compiler-rt] 26a7ee3 - [NFC][asan] Use RoundDownTo

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 18:51:08 PDT 2022


Author: Vitaly Buka
Date: 2022-07-20T18:50:44-07:00
New Revision: 26a7ee3d54794bfe467c03ece7cde19129f95c06

URL: https://github.com/llvm/llvm-project/commit/26a7ee3d54794bfe467c03ece7cde19129f95c06
DIFF: https://github.com/llvm/llvm-project/commit/26a7ee3d54794bfe467c03ece7cde19129f95c06.diff

LOG: [NFC][asan] Use RoundDownTo

Added: 
    

Modified: 
    compiler-rt/lib/asan/asan_interceptors.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_interceptors.cpp b/compiler-rt/lib/asan/asan_interceptors.cpp
index 6c843968f7af5..7cd8343465af0 100644
--- a/compiler-rt/lib/asan/asan_interceptors.cpp
+++ b/compiler-rt/lib/asan/asan_interceptors.cpp
@@ -245,7 +245,7 @@ DEFINE_REAL_PTHREAD_FUNCTIONS
 static void ClearShadowMemoryForContextStack(uptr stack, uptr ssize) {
   // Align to page size.
   uptr PageSize = GetPageSizeCached();
-  uptr bottom = stack & ~(PageSize - 1);
+  uptr bottom = RoundDownTo(stack, PageSize);
   ssize += stack - bottom;
   ssize = RoundUpTo(ssize, PageSize);
   static const uptr kMaxSaneContextStackSize = 1 << 22;  // 4 Mb


        


More information about the llvm-commits mailing list