From: Kirill Stoimenov Date: Wed, 14 Dec 2022 23:47:25 +0000 (+0000) Subject: [HWASAN] Added dtls_ member variable which is needed by __lsan::GetThreadRangesLocked. X-Git-Tag: upstream/17.0.6~23767 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfdc1a795a2637fcf9fa750571da153c0d117b4a;p=platform%2Fupstream%2Fllvm.git [HWASAN] Added dtls_ member variable which is needed by __lsan::GetThreadRangesLocked. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D140065 --- diff --git a/compiler-rt/lib/hwasan/hwasan_thread.cpp b/compiler-rt/lib/hwasan/hwasan_thread.cpp index c776ae1..f14f33e 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 296fa8f..1deec76 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_;