summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/msan_thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/msan/msan_thread.cc')
-rw-r--r--compiler-rt/lib/msan/msan_thread.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/msan_thread.cc b/compiler-rt/lib/msan/msan_thread.cc
index 2289be3189d..5fe99f68b79 100644
--- a/compiler-rt/lib/msan/msan_thread.cc
+++ b/compiler-rt/lib/msan/msan_thread.cc
@@ -3,6 +3,8 @@
#include "msan_thread.h"
#include "msan_interface_internal.h"
+#include "sanitizer_common/sanitizer_tls_get_addr.h"
+
namespace __msan {
MsanThread *MsanThread::Create(thread_callback_t start_routine,
@@ -33,6 +35,9 @@ void MsanThread::ClearShadowForThreadStackAndTLS() {
__msan_unpoison((void *)stack_bottom_, stack_top_ - stack_bottom_);
if (tls_begin_ != tls_end_)
__msan_unpoison((void *)tls_begin_, tls_end_ - tls_begin_);
+ DTLS *dtls = DTLS_Get();
+ for (uptr i = 0; i < dtls->dtv_size; ++i)
+ __msan_unpoison((void *)(dtls->dtv[i].beg), dtls->dtv[i].size);
}
void MsanThread::Init() {
@@ -55,6 +60,7 @@ void MsanThread::Destroy() {
ClearShadowForThreadStackAndTLS();
uptr size = RoundUpTo(sizeof(MsanThread), GetPageSizeCached());
UnmapOrDie(this, size);
+ DTLS_Destroy();
}
thread_return_t MsanThread::ThreadStart() {
OpenPOWER on IntegriCloud