[PATCH] D33286: Don't require ThreadState to be contained within tls on all platforms

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 02:04:57 PDT 2017


dvyukov added inline comments.


================
Comment at: lib/tsan/rtl/tsan_platform_mac.cc:248
+  // make sure we don't clobber it.
+  tls_addr += sizeof(uptr);
+  tls_size -= sizeof(uptr);
----------------
This looks quite fragile.
I would suggest to factor out part that computes location of ThreadState pointer from cur_thread(). E.g. introduce `ThreadState **cur_thread_location()`. And then use it in cur_thread() and here to skip the right word.


https://reviews.llvm.org/D33286





More information about the llvm-commits mailing list