[llvm-branch-commits] [compiler-rt] 2cea9fc - Take into account kDtvOffset

Vitaly Buka via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Sep 11 07:58:06 PDT 2024


Author: Vitaly Buka
Date: 2024-09-11T07:57:35-07:00
New Revision: 2cea9fc35f2a864f2c745641510f16b05c90534a

URL: https://github.com/llvm/llvm-project/commit/2cea9fc35f2a864f2c745641510f16b05c90534a
DIFF: https://github.com/llvm/llvm-project/commit/2cea9fc35f2a864f2c745641510f16b05c90534a.diff

LOG: Take into account kDtvOffset

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cpp
index a1107ff7d24737..6e77676fabf091 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cpp
@@ -152,8 +152,8 @@ DTLS::DTV *DTLS_on_tls_get_addr(void *arg_void, void *res,
     tls_size = 0;
   }
   if (tls_size) {
-    CHECK_LE(tls_beg, reinterpret_cast<uptr>(res));
-    CHECK_LT(reinterpret_cast<uptr>(res), tls_beg + tls_size);
+    CHECK_LE(tls_beg, reinterpret_cast<uptr>(res) + kDtvOffset);
+    CHECK_LT(reinterpret_cast<uptr>(res) + kDtvOffset, tls_beg + tls_size);
   }
   dtv->beg = tls_beg;
   dtv->size = tls_size;


        


More information about the llvm-branch-commits mailing list