[compiler-rt] bfdc1a7 - [HWASAN] Added dtls_ member variable which is needed by __lsan::GetThreadRangesLocked.

Kirill Stoimenov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 16:20:48 PST 2022


Author: Kirill Stoimenov
Date: 2022-12-15T00:20:29Z
New Revision: bfdc1a795a2637fcf9fa750571da153c0d117b4a

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

LOG: [HWASAN] Added dtls_ member variable which is needed by __lsan::GetThreadRangesLocked.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D140065

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_thread.cpp
    compiler-rt/lib/hwasan/hwasan_thread.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_thread.cpp b/compiler-rt/lib/hwasan/hwasan_thread.cpp
index c776ae179cec2..f14f33ec62369 100644
--- a/compiler-rt/lib/hwasan/hwasan_thread.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_thread.cpp
@@ -54,6 +54,7 @@ void Thread::Init(uptr stack_buffer_start, uptr stack_buffer_size,
   InitStackRingBuffer(stack_buffer_start, stack_buffer_size);
 #endif
   InitStackAndTls(state);
+  dtls_ = DTLS_Get();
 }
 
 void Thread::InitStackRingBuffer(uptr stack_buffer_start,

diff  --git a/compiler-rt/lib/hwasan/hwasan_thread.h b/compiler-rt/lib/hwasan/hwasan_thread.h
index 296fa8f2760f1..1deec76a4e65c 100644
--- a/compiler-rt/lib/hwasan/hwasan_thread.h
+++ b/compiler-rt/lib/hwasan/hwasan_thread.h
@@ -46,6 +46,7 @@ class Thread {
   uptr stack_size() { return stack_top() - stack_bottom(); }
   uptr tls_begin() { return tls_begin_; }
   uptr tls_end() { return tls_end_; }
+  DTLS *dtls() { return dtls_; }
   bool IsMainThread() { return unique_id_ == 0; }
 
   bool AddrIsInStack(uptr addr) {
@@ -81,6 +82,7 @@ class Thread {
   uptr stack_bottom_;
   uptr tls_begin_;
   uptr tls_end_;
+  DTLS *dtls_;
 
   u32 random_state_;
   u32 random_buffer_;


        


More information about the llvm-commits mailing list