diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-12-27 22:16:28 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-12-27 22:16:28 +0000 |
commit | 8ed1379899d55f9390abf2b1209cd57baa53beca (patch) | |
tree | eee97ed98b537c17d15fc2dd5247a196b30a0c9a /compiler-rt | |
parent | 037ea1ff4a7055b662189ba81b9197b7dee3fcb0 (diff) |
[asan] Fix build on windows.
Reviewers: vitalybuka
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D56111
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/asan/asan_thread.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/asan_thread.cc b/compiler-rt/lib/asan/asan_thread.cc index 921d023e78f..6b4e09e6f8f 100644 --- a/compiler-rt/lib/asan/asan_thread.cc +++ b/compiler-rt/lib/asan/asan_thread.cc @@ -285,13 +285,21 @@ AsanThread *CreateMainThread() { return main_thread; } +static bool StackLimitsAreAvailable() { +#if SANITIZER_WINDOWS + return true; +#else + return MemoryMappingLayout::IsAvailable(); +#endif +} + // This implementation doesn't use the argument, which is just passed down // from the caller of Init (which see, above). It's only there to support // OS-specific implementations that need more information passed through. void AsanThread::SetThreadStackAndTls(const InitOptions *options) { DCHECK_EQ(options, nullptr); // If this process is "init" (pid 1), /proc may not be mounted yet. - if (!start_routine_ && !MemoryMappingLayout::IsAvailable()) { + if (!start_routine_ && !StackLimitsAreAvailable()) { stack_top_ = stack_bottom_ = 0; tls_begin_ = tls_end_ = 0; } else { |