[PATCH] D46585: Align ClearShadowForThreadStackAndTLS for NetBSD/i386

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 18:23:50 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT332792: Align ClearShadowForThreadStackAndTLS for NetBSD/i386 (authored by kamil, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D46585?vs=145712&id=147633#toc

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D46585

Files:
  lib/asan/asan_thread.cc


Index: lib/asan/asan_thread.cc
===================================================================
--- lib/asan/asan_thread.cc
+++ lib/asan/asan_thread.cc
@@ -303,8 +303,13 @@
 
 void AsanThread::ClearShadowForThreadStackAndTLS() {
   PoisonShadow(stack_bottom_, stack_top_ - stack_bottom_, 0);
-  if (tls_begin_ != tls_end_)
-    PoisonShadow(tls_begin_, tls_end_ - tls_begin_, 0);
+  if (tls_begin_ != tls_end_) {
+    uptr tls_begin_aligned = RoundDownTo(tls_begin_, SHADOW_GRANULARITY);
+    uptr tls_end_aligned = RoundUpTo(tls_end_, SHADOW_GRANULARITY);
+    FastPoisonShadowPartialRightRedzone(tls_begin_aligned,
+                                        tls_end_ - tls_begin_aligned,
+                                        tls_end_aligned - tls_end_, 0);
+  }
 }
 
 bool AsanThread::GetStackFrameAccessByAddr(uptr addr,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46585.147633.patch
Type: text/x-patch
Size: 829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180519/e092a677/attachment.bin>


More information about the llvm-commits mailing list