[PATCH] D46585: Align ClearShadowForThreadStackAndTLS for NetBSD/i386

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 8 09:49:32 PDT 2018


krytarowski updated this revision to Diff 145712.
krytarowski added a comment.

Typo.


Repository:
  rL LLVM

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
@@ -300,8 +300,11 @@
 
 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);
+    PoisonShadow(tls_begin_aligned, tls_end_aligned - tls_begin_aligned, 0);
+  }
 }
 
 bool AsanThread::GetStackFrameAccessByAddr(uptr addr,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46585.145712.patch
Type: text/x-patch
Size: 703 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180508/0f10516d/attachment.bin>


More information about the llvm-commits mailing list