diff options
author | Sergey Matveev <earthdok@google.com> | 2013-05-07 14:41:43 +0000 |
---|---|---|
committer | Sergey Matveev <earthdok@google.com> | 2013-05-07 14:41:43 +0000 |
commit | 24323de08fa8850712d56621bff29dbbbd0285a9 (patch) | |
tree | 2ac35bf2be079d42730993b97616e163d5ab4b84 /lib/sanitizer_common/sanitizer_win.cc | |
parent | 2be3a283939d4fc14ad86f6cd8be34b1468f22ba (diff) | |
download | compiler-rt-24323de08fa8850712d56621bff29dbbbd0285a9.tar.gz compiler-rt-24323de08fa8850712d56621bff29dbbbd0285a9.tar.bz2 compiler-rt-24323de08fa8850712d56621bff29dbbbd0285a9.tar.xz |
[sanitizer] Move GetThreadStackAndTls from TSan to sanitizer_common.
Move this function to sanitizer_common because LSan uses it too. Also, fix a bug
where the TLS range reported for main thread was off by the size of the thread
descriptor from libc (TSan doesn't care much, but for LSan it's critical).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_win.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_win.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_win.cc b/lib/sanitizer_common/sanitizer_win.cc index 88023e67..48874a1d 100644 --- a/lib/sanitizer_common/sanitizer_win.cc +++ b/lib/sanitizer_common/sanitizer_win.cc @@ -336,6 +336,16 @@ uptr GetTlsSize() { void InitTlsSize() { } +void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, + uptr *tls_addr, uptr *tls_size) { + uptr stack_top, stack_bottom; + GetThreadStackTopAndBottom(main, &stack_top, &stack_bottom); + *stk_addr = stack_bottom; + *stk_size = stack_top - stack_bottom; + *tls_addr = 0; + *tls_size = 0; +} + } // namespace __sanitizer #endif // _WIN32 |