[llvm-branch-commits] [compiler-rt] 56aff1c - Take into account kDtvOffset

Vitaly Buka via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 10 17:52:11 PDT 2024


Author: Vitaly Buka
Date: 2024-09-10T17:51:36-07:00
New Revision: 56aff1c53215bb9cbd1ead977428bb793abf7848

URL: https://github.com/llvm/llvm-project/commit/56aff1c53215bb9cbd1ead977428bb793abf7848
DIFF: https://github.com/llvm/llvm-project/commit/56aff1c53215bb9cbd1ead977428bb793abf7848.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